diff options
author | EuAndreh <eu@euandre.org> | 2022-01-18 11:40:47 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-01-18 14:02:59 -0300 |
commit | 47bfd2ed8c3219e79f8974a8fc2ac9265ed91bd2 (patch) | |
tree | 3d162596d874b4f775da12c843ad3918b593f713 /aux/ci/git-post-receive.sh | |
parent | Initial empty commit (diff) | |
download | td-47bfd2ed8c3219e79f8974a8fc2ac9265ed91bd2.tar.gz td-47bfd2ed8c3219e79f8974a8fc2ac9265ed91bd2.tar.xz |
First commit, now with a clean history
Diffstat (limited to 'aux/ci/git-post-receive.sh')
-rwxr-xr-x | aux/ci/git-post-receive.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/aux/ci/git-post-receive.sh b/aux/ci/git-post-receive.sh new file mode 100755 index 0000000..92bba73 --- /dev/null +++ b/aux/ci/git-post-receive.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -eu + +for n in $(seq 0 $((GIT_PUSH_OPTION_COUNT - 1))); do + opt="$(eval "echo \$GIT_PUSH_OPTION_$n")" + if [ "$opt" = skip-ci ] || [ "$opt" = ci-skip ]; then + printf "\n'%s' option detected, not running ci-build.sh\n\n" \ + "$opt" + exit 0 + fi +done + +# shellcheck disable=2034 +read -r _oldrev SHA _refname + +PROJECT="$(basename "$PWD" | cut -d. -f1)" # remove .git suffix +LOGS_DIR="/opt/ci/$PROJECT/logs" +sh "/opt/ci/$PROJECT/ci-build.sh" "$PROJECT" "$LOGS_DIR" "$SHA" ||: + +echo 'To retrigger the build, run:' +echo "cd /srv/http/$PROJECT.git/" +echo "sh /opt/ci/$PROJECT/ci-build.sh" "$PROJECT" "$LOGS_DIR" "$SHA" |