diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-10-12 02:44:25 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-10-12 02:44:25 +0200 |
commit | de580e7999400b7d8789ce3747db4f2a63f2538b (patch) | |
tree | 968cd75d779c844123dc10a0b3999f80628c90cc /tests/blogc-git-receiver/check_pre_receive.sh | |
parent | bc7d2545d47bf54acebb38ab3d1e2dd7251ddb99 (diff) | |
download | blogc-de580e7999400b7d8789ce3747db4f2a63f2538b.tar.gz blogc-de580e7999400b7d8789ce3747db4f2a63f2538b.tar.bz2 blogc-de580e7999400b7d8789ce3747db4f2a63f2538b.zip |
build: use bash, but get it properly during build time
hardcoding it for travis, as bash is always installed there.
Diffstat (limited to 'tests/blogc-git-receiver/check_pre_receive.sh')
-rwxr-xr-x | tests/blogc-git-receiver/check_pre_receive.sh | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/tests/blogc-git-receiver/check_pre_receive.sh b/tests/blogc-git-receiver/check_pre_receive.sh deleted file mode 100755 index 2df713a..0000000 --- a/tests/blogc-git-receiver/check_pre_receive.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/sh - -set -xe -o pipefail - -export LC_ALL=C - -TEMP="$(mktemp -d)" -[[ -n "${TEMP}" ]] - -trap_func() { - [[ -e "${TEMP}/output.txt" ]] && cat "${TEMP}/output.txt" - [[ -n "${TEMP}" ]] && rm -rf "${TEMP}" -} - -trap trap_func EXIT - -mkdir -p "${TEMP}/repos" -git init --bare "${TEMP}/repos/foo.git" &> /dev/null - -SELF="${PWD}/blogc-git-receiver" - -ln -s "${SELF}" "${TEMP}/repos/foo.git/hooks/pre-receive" - -cat > "${TEMP}/payload.txt" <<EOF -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/foo -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/bar -EOF - -cd "${TEMP}/repos/foo.git" - -SHELL="${SELF}" HOME="${TEMP}" ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" -grep "warning: no reference to master branch found. nothing to deploy." "${TEMP}/output.txt" &> /dev/null - -cat > "${TEMP}/tmp.txt" <<EOF -blob -mark :1 -data 63 -all: - mkdir -p \$(OUTPUT_DIR) - echo lol > \$(OUTPUT_DIR)/foo.txt - -reset refs/heads/master -commit refs/heads/master -mark :2 -author Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476139736 +0200 -committer Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476139736 +0200 -data 11 -testing... -M 100644 :1 Makefil - -EOF - -git fast-import < "${TEMP}/tmp.txt" &> /dev/null - -cat > "${TEMP}/payload.txt" <<EOF -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/foo -0000000000000000000000000000000000000000 $(git rev-parse HEAD) refs/heads/master -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/bar -EOF - -SHELL="${SELF}" HOME="${TEMP}" ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" -grep "warning: no makefile found. skipping ..." "${TEMP}/output.txt" &> /dev/null - -cd "${TEMP}" -git init --bare "${TEMP}/repos/foo2.git" &> /dev/null -ln -s "${SELF}" "${TEMP}/repos/foo2.git/hooks/pre-receive" - -cat > "${TEMP}/tmp.txt" <<EOF -blob -mark :1 -data 63 -all: - mkdir -p \$(OUTPUT_DIR) - echo lol > \$(OUTPUT_DIR)/foo.txt - -reset refs/heads/master -commit refs/heads/master -mark :2 -author Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476139736 +0200 -committer Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476139736 +0200 -data 11 -testing... -M 100644 :1 Makefile - -EOF - -cd "${TEMP}/repos/foo2.git" -git fast-import < "${TEMP}/tmp.txt" &> /dev/null - -cat > "${TEMP}/payload.txt" <<EOF -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/foo -0000000000000000000000000000000000000000 $(git rev-parse HEAD) refs/heads/master -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/bar -EOF - -SHELL="${SELF}" HOME="${TEMP}" ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" -grep "echo lol" "${TEMP}/output.txt" &> /dev/null - -[[ -h htdocs ]] -[[ "$(cat htdocs/foo.txt)" == "lol" ]] - -DEST="$(readlink htdocs)" -[[ -e "${DEST}" ]] - -cd "${TEMP}" -git init --bare "${TEMP}/repos/foo3.git" &> /dev/null -ln -s "${SELF}" "${TEMP}/repos/foo3.git/hooks/pre-receive" - -cat > "${TEMP}/tmp.txt" <<EOF -blob -mark :1 -data 64 -all: - mkdir -p \$(OUTPUT_DIR) - echo lol > \$(OUTPUT_DIR)/foo.txt - - -commit refs/heads/master -mark :2 -author Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476142917 +0200 -committer Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476142917 +0200 -data 12 -testing2... -M 100644 :1 Makefile - -EOF - -cd "${TEMP}/repos/foo3.git" -ln -s "${DEST}" htdocs -git fast-import < "${TEMP}/tmp.txt" &> /dev/null - -cat > "${TEMP}/payload.txt" <<EOF -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/foo -0000000000000000000000000000000000000000 $(git rev-parse HEAD) refs/heads/master -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/bar -EOF - -SHELL="${SELF}" HOME="${TEMP}" ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" -grep "echo lol" "${TEMP}/output.txt" &> /dev/null - -[[ -h htdocs ]] -[[ "$(cat htdocs/foo.txt)" == "lol" ]] -[[ "${DEST}" != "$(readlink htdocs)" ]] -[[ ! -e "${DEST}" ]] - -rm "${TEMP}/output.txt" |