diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-05-28 23:56:55 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-05-28 23:56:55 -0700 |
commit | 6d3cefc29d596fcce0d436391eb6feec16bf2018 (patch) | |
tree | 096b16849467669a3542ee2a3e76c57e4da827dd /playbooks/roles/src/templates/volumes/soft-serve/hooks/update | |
parent | b8ffbfe27eae919750ef4d3facf02393d1004287 (diff) | |
download | infra-6d3cefc29d596fcce0d436391eb6feec16bf2018.tar.gz infra-6d3cefc29d596fcce0d436391eb6feec16bf2018.zip |
CI part one
Diffstat (limited to 'playbooks/roles/src/templates/volumes/soft-serve/hooks/update')
-rwxr-xr-x | playbooks/roles/src/templates/volumes/soft-serve/hooks/update | 68 |
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> -- |