summaryrefslogtreecommitdiff
path: root/playbooks/roles/src/templates/volumes/soft-serve/hooks/update
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/roles/src/templates/volumes/soft-serve/hooks/update')
-rwxr-xr-xplaybooks/roles/src/templates/volumes/soft-serve/hooks/update68
1 files changed, 68 insertions, 0 deletions
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> --