summaryrefslogtreecommitdiff
path: root/playbooks/roles/src/templates/volumes
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-05-28 23:56:55 -0700
committerElizabeth Hunt <me@liz.coffee>2025-05-28 23:56:55 -0700
commit6d3cefc29d596fcce0d436391eb6feec16bf2018 (patch)
tree096b16849467669a3542ee2a3e76c57e4da827dd /playbooks/roles/src/templates/volumes
parentb8ffbfe27eae919750ef4d3facf02393d1004287 (diff)
downloadinfra-6d3cefc29d596fcce0d436391eb6feec16bf2018.tar.gz
infra-6d3cefc29d596fcce0d436391eb6feec16bf2018.zip
CI part one
Diffstat (limited to 'playbooks/roles/src/templates/volumes')
-rw-r--r--playbooks/roles/src/templates/volumes/cgit.nginx.conf49
-rw-r--r--playbooks/roles/src/templates/volumes/cgit/cgit-css/cgit.pngbin25036 -> 0 bytes
-rw-r--r--playbooks/roles/src/templates/volumes/cgit/index.html1
-rwxr-xr-xplaybooks/roles/src/templates/volumes/data/hooks/update37
-rw-r--r--playbooks/roles/src/templates/volumes/soft-serve/.gitkeep (renamed from playbooks/roles/src/templates/volumes/data/.gitkeep)0
-rwxr-xr-xplaybooks/roles/src/templates/volumes/soft-serve/hooks/update68
6 files changed, 68 insertions, 87 deletions
diff --git a/playbooks/roles/src/templates/volumes/cgit.nginx.conf b/playbooks/roles/src/templates/volumes/cgit.nginx.conf
deleted file mode 100644
index 5abe189..0000000
--- a/playbooks/roles/src/templates/volumes/cgit.nginx.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-server {
- listen 80;
- server_name localhost;
-
- #charset koi8-r;
- #access_log /var/log/nginx/log/host.access.log main;
-
- location / {
- root /usr/share/cgit/;
- }
-
- location /cgit {
- try_files $uri @cgit;
- }
-
- location @cgit {
- fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
-
- fastcgi_param HTTP_HOST $server_name;
- fastcgi_split_path_info ^(/cgit/?)(.+)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param QUERY_INFO $uri;
-
- include fastcgi_params;
-
- fastcgi_pass unix:/var/run/fcgiwrap.socket;
- }
-
- location /cgit-css/ {
- rewrite ^/cgit-css(/.*)$ $1 break;
- root /usr/share/cgit/cgit-css/;
- }
-
- error_page 404 /404.html;
- error_page 401 /401.html;
-
- # redirect server error pages to the static page /50x.html
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
-
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
-}
diff --git a/playbooks/roles/src/templates/volumes/cgit/cgit-css/cgit.png b/playbooks/roles/src/templates/volumes/cgit/cgit-css/cgit.png
deleted file mode 100644
index bb7ffa1..0000000
--- a/playbooks/roles/src/templates/volumes/cgit/cgit-css/cgit.png
+++ /dev/null
Binary files differ
diff --git a/playbooks/roles/src/templates/volumes/cgit/index.html b/playbooks/roles/src/templates/volumes/cgit/index.html
deleted file mode 100644
index 4b06983..0000000
--- a/playbooks/roles/src/templates/volumes/cgit/index.html
+++ /dev/null
@@ -1 +0,0 @@
-<h1>hai</h1>
diff --git a/playbooks/roles/src/templates/volumes/data/hooks/update b/playbooks/roles/src/templates/volumes/data/hooks/update
deleted file mode 100755
index 5723dc5..0000000
--- a/playbooks/roles/src/templates/volumes/data/hooks/update
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-#
-
-refname="$1"
-oldrev="$2"
-newrev="$3"
-
-# Safety check
-if [ -z "$GIT_DIR" ]; then
- echo "Don't run this script from the command line." >&2
- echo " (if you want, you could supply GIT_DIR then run" >&2
- echo " $0 <ref> <oldrev> <newrev>)" >&2
- exit 1
-fi
-
-if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
- echo "usage: $0 <ref> <oldrev> <newrev>" >&2
- exit 1
-fi
-
-# Check types
-# if $newrev is 0000...0000, it's a commit to delete a ref.
-zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
-if [ "$newrev" = "$zero" ]; then
- newrev_type=delete
-else
- newrev_type=$(git cat-file -t $newrev)
-fi
-
-echo "Hi from Soft Serve update hook!"
-echo "$GITDIR"
-echo "RefName: $refname"
-echo "Change Type: $newrev_type"
-echo "Old SHA1: $oldrev"
-echo "New SHA1: $newrev"
-
-exit 0
diff --git a/playbooks/roles/src/templates/volumes/data/.gitkeep b/playbooks/roles/src/templates/volumes/soft-serve/.gitkeep
index e69de29..e69de29 100644
--- a/playbooks/roles/src/templates/volumes/data/.gitkeep
+++ b/playbooks/roles/src/templates/volumes/soft-serve/.gitkeep
diff --git a/playbooks/roles/src/templates/volumes/soft-serve/hooks/update b/playbooks/roles/src/templates/volumes/soft-serve/hooks/update
new file mode 100755
index 0000000..a97e5f9
--- /dev/null
+++ b/playbooks/roles/src/templates/volumes/soft-serve/hooks/update
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# -- <logo> --
+function logo() {
+ git config --global color.ui auto
+
+cat <<'EOF'
+--| |--
+--| ~ welcome to ~ |--
+--| |--
+--| .-. _ .--. .--. |--
+--| :.: :_; : .-': .-' |--
+--| :.: .-..---. .--. .--. : `; : `;.--. .--. |--
+--| :.:_ : :`-'_.' _ ' ..'' .; :: : : :' '_.'' '_.' |--
+--| `.__;:_;`.___;:_;`.__.'`.__.':_; :_;`.__.'`.__.' |--
+--| |--
+--| ~₊˚⊹ ⋆˚✿˖°~ -────୨ৎ────- ~₊˚⊹ ⋆˚✿˖°~ |--
+--| ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ |--
+--| ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⠒⠉⠉⠉⣀⣂⣅⠬⡉⠭⢛⠿⢟⡶⣄⡀⠀⠀⠀⠀ we'll get brewing |--
+--| ⠀⠀⠀⠀⠀⠀⠀⣠⠞⠁⠀⣄⢎⢩⢸⢉⣵⡖⢰⣶⣮⢹⣦⣡⢊⢻⡿⣦⠀⠀⠀ right away! |--
+--| ⠀⠀⠀⠀⠀⠀⢠⡇⠀⠀⢎⠕⢭⢪⡶⠈⢿⣷⣿⠟⣋⣚⣯⣒⣣⡑⢨⢻⡇⠀⣀⣀⠀⠀⠀ |--
+--| ⠀⠀⠀⠀⠀⣀⡼⣧⠀⠄⡊⢼⡩⣾⢌⠳⡜⣉⡠⡜⡞⣵⣊⡧⡠⠝⣣⡾⠁⠀⠻⠿⠗⠀⠀ /) /) (\ (\ |--
+--| ⠀⠀⠀⣢⣾⡟⣥⠻⣷⣌⡀⠬⡘⢅⡟⡇⡮⣷⡾⡿⢋⣉⢣⢔⣎⠿⠊⠀⠀⡴⣛⠆⠌⠀⠀ ( . .) (. . ) |--
+--| ⠀⢀⣶⡟⣡⣿⣿⣟⢯⣟⢿⣷⣶⣯⣬⣵⣾⣷⣶⡾⠧⠞⠓⠉⠀⠀⠀⢀⠘⠈⠀⠠⢘⡤⠀ ( づ ˚♡︎˖ ⊂ ) |--
+--| ⠄⣾⠏⣐⣛⡻⢿⣿⣯⣿⣿⣿⣾⣽⣛⣍⢃⡂⢄⠀⡀⠀⡀⠄⢂⠄⠡⢈⠒⡈⢒⠘⠴⢀⠀ |--
+--| ⢰⣿⠀⠈⠻⣜⣄⠈⢙⣾⢿⣿⣿⣿⡿⣜⢣⡜⢢⠁⠄⡐⢠⢉⠂⠌⠀⡀⠄⠐⡀⠄⠐⠀⢐ ___ |--
+--| ⠸⣟⠀⡐⡅⠈⠑⠀⠊⠝⠈⢖⡿⠿⣿⣾⡱⢊⠅⡌⡰⢌⢆⠣⠈⢀⠐⠀⠄⠂⠠⡈⠠⣈⡧ (...) |--
+--| ⠀⢿⣆⠱⣘⣧⣤⣀⣀⡀⢒⡥⣑⢨⠒⡰⠯⠾⡼⠶⠙⢈⠀⣀⠂⡄⢂⣁⢢⣑⣶⡽⣳⠟⠁ _ \ _ |--
+--| ⠀⠀⠻⣧⡜⢹⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣴⡀⡀⠀⠛⠺⢿⣶⣿⣾⣷⣿⣿⣿⢟⣵⠏⠀⠀ ('> <') |--
+--| ⠀⠀⠀⠈⠿⣶⣉⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣧⣤⢀⠀⠀⠈⠉⠙⠻⣯⡷⠟⠁⠀⠀⠀ (v) (v) |--
+--| ⠀⠀⠀⠀⠀⠈⠙⠿⣶⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣞⣤⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀\(__w w__)/ |--
+--| ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠛⠛⠿⠿⠿⠿⠿⠿⠛⠛⠛⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ |--
+--| |--
+--| |--
+EOF
+}
+# -- </logo> --
+
+# -- <continuous_integration> --
+refname="$1"
+_oldrev="$2"
+rev="$3"
+
+function post_trigger_ci_jobs() {
+ local host="cihooks"
+ local port="9000"
+ local path="/job"
+ local json_payload=$(printf '{"type": "ci_pipeline", "arguments": {"remote": "%s", "rev": "%s", "refname": "%s"}}' "$1" "$2" "$3")
+
+ echo "> $json_payload"
+
+ which curl 2&>/dev/null || apk add -q curl
+
+ curl --silent --show-error -X POST \
+ -H "Content-Type: application/json" \ -H "Connection: close" \
+ -d "$json_payload" \
+ "http://$host:$port$path"
+
+ echo "... Done!"
+}
+# -- </continuous_integration> --
+
+# -- <main> --
+remote="ssh://{{ src_domain }}:2222/$(basename "$PWD")"
+
+logo
+post_trigger_ci_jobs "$remote" "$rev" "$refname"
+# -- </main> --