blob: 989173ab503c964402bdffd2830f2cc154a76e47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#!/bin/bash
# -- <logo> --
function logo() {
git config --global color.ui auto
# ANSI escape codes
local HIDE_CURSOR='\033[?25l'
local SHOW_CURSOR='\033[?25h'
# Hide cursor for cleaner animation
echo -ne "$HIDE_CURSOR"
# Print logo line by line with delay
cat <<'EOF' | while IFS= read -r line; do
{{ colored_logo }}
EOF
echo -e "$line"
sleep 0.1
done
# Show cursor again
echo -ne "$SHOW_CURSOR"
}
# -- </logo> --
# -- <continuous_integration> --
refname="$1"
_oldrev="$2"
rev="$3"
post_trigger_ci_jobs() {
local host="ci_server"
local port="9000"
local path="/job"
local json_payload=$(printf '{"type": "ci_pipeline", "arguments": {"remote": "%s", "rev": "%s", "refname": "%s"}}' "$1" "$2" "$3")
which curl 2&>/dev/null || apk add -q curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Connection: close" \
-d "$json_payload" \
--no-progress-meter \
"http://$host:$port$path"
}
# -- </continuous_integration> --
# -- <main> --
remote="ssh://{{ src_domain }}:2222/$(basename "$PWD")"
logo
post_trigger_ci_jobs "$remote" "$rev" "$refname"
# -- </main> --
|