summaryrefslogtreecommitdiff
path: root/src/post-receive
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-08-28 16:46:50 -0300
committerEuAndreh <eu@euandre.org>2024-08-29 10:09:35 -0300
commit05266ce5f801745c12b5e082e4be65f21108127b (patch)
treec8ef94b5833b96749cc7aa069a6cd10ad09071a7 /src/post-receive
parentInitial empty commit (diff)
downloadcicd-05266ce5f801745c12b5e082e4be65f21108127b.tar.gz
cicd-05266ce5f801745c12b5e082e4be65f21108127b.tar.xz
v0 scratch without polling in cicdd
Diffstat (limited to 'src/post-receive')
-rwxr-xr-xsrc/post-receive34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/post-receive b/src/post-receive
new file mode 100755
index 0000000..2dc4128
--- /dev/null
+++ b/src/post-receive
@@ -0,0 +1,34 @@
+#!/bin/sh
+set -eu
+
+
+
+read -r _oldrev SHA REFNAME
+
+if [ "$SHA" = '0000000000000000000000000000000000000000' ]; then
+ exit
+fi
+
+
+DEPLOY_OPT=
+for n in `seq 0 $((GIT_PUSH_OPTION_COUNT - 1))`; do
+ opt="$(eval "printf '%s' \"\$GIT_PUSH_OPTION_$n\"")"
+ case "$opt" in
+ (ci.skip)
+ cat <<-EOF >&2
+
+ "$opt" option detected, not running CI.
+
+ EOF
+ exit
+ ;;
+ (deploy.skip)
+ DEPLOY_OPT=-n
+ ;;
+ (*)
+ ;;
+ esac
+done
+
+
+cicd add $DEPLOY_OPT -V "$SHA" -R "$REFNAME" "$PWD"