Commit f8cda8eb authored by Ralf Jung's avatar Ralf Jung
Browse files

use CI_COMMIT_BRANCH instead of CI_COMMIT_REF_NAME (preparing for merge pipelines)

parent b968ab46
...@@ -73,7 +73,7 @@ if [[ -n "$DENY_WARNINGS" ]] && egrep -q "^Warning:" build-log.txt; then ...@@ -73,7 +73,7 @@ if [[ -n "$DENY_WARNINGS" ]] && egrep -q "^Warning:" build-log.txt; then
fi fi
# maybe submit timing information # maybe submit timing information
if [[ "$CI_RUNNER_DESCRIPTION" == "coop-timing" ]]; then if [[ "$CI_RUNNER_DESCRIPTION" == "coop-timing" && -n "$CI_COMMIT_BRANCH" ]]; then
# collect all information into one file # collect all information into one file
status "[buildjob] Build performance information" status "[buildjob] Build performance information"
find -name "*.v.perf" -print0 | xargs -0 cat > build-times.txt find -name "*.v.perf" -print0 | xargs -0 cat > build-times.txt
...@@ -87,28 +87,28 @@ if [[ "$CI_RUNNER_DESCRIPTION" == "coop-timing" ]]; then ...@@ -87,28 +87,28 @@ if [[ "$CI_RUNNER_DESCRIPTION" == "coop-timing" ]]; then
panic "[buildjob] TIMING_SECRET variable is missing" panic "[buildjob] TIMING_SECRET variable is missing"
fi fi
# Submit to webhook endpoint # Submit to webhook endpoint
status "[buildjob] Submitting timing information to coq-speed (Project: $TIMING_PROJECT, Branch: $CI_COMMIT_REF_NAME, Config: $TIMING_CONF)" status "[buildjob] Submitting timing information to coq-speed (Project: $TIMING_PROJECT, Branch: $CI_COMMIT_BRANCH, Config: $TIMING_CONF)"
curl --fail -sS -X POST https://coq-speed.mpi-sws.org/webhook/build_times \ curl --fail -sS -X POST https://coq-speed.mpi-sws.org/webhook/build_times \
--user "$TIMING_SECRET" \ --user "$TIMING_SECRET" \
-H "X-Commit: $CI_COMMIT_SHA" \ -H "X-Commit: $CI_COMMIT_SHA" \
-H "X-Project: $TIMING_PROJECT" \ -H "X-Project: $TIMING_PROJECT" \
-H "X-Branch: $CI_COMMIT_REF_NAME" \ -H "X-Branch: $CI_COMMIT_BRANCH" \
-H "X-Config: $TIMING_CONF" \ -H "X-Config: $TIMING_CONF" \
-H "X-Date: $(git show $CI_COMMIT_SHA -s --pretty=%cI)" \ -H "X-Date: $(git show $CI_COMMIT_SHA -s --pretty=%cI)" \
--data-binary @- < build-times.txt --data-binary @- < build-times.txt
fi fi
# maybe create opam package # maybe create opam package
if [[ -n "$OPAM_PKG" && "$CI_COMMIT_REF_NAME" == "master" ]]; then if [[ -n "$OPAM_PKG" && "$CI_COMMIT_BRANCH" == "master" ]]; then
# check if we have the secret # check if we have the secret
if [[ -z "$OPAM_UPDATE_SECRET" ]]; then if [[ -z "$OPAM_UPDATE_SECRET" ]]; then
panic "[buildjob] OPAM_UPDATE_SECRET variable is missing" panic "[buildjob] OPAM_UPDATE_SECRET variable is missing"
fi fi
# determine package name prefix # determine package name prefix
if [[ "$CI_COMMIT_REF_NAME" == master ]]; then if [[ "$CI_COMMIT_BRANCH" == master ]]; then
OPAM_PKG_PREFIX=dev OPAM_PKG_PREFIX=dev
else else
OPAM_PKG_PREFIX="branch.$CI_COMMIT_REF_NAME" OPAM_PKG_PREFIX="branch.$CI_COMMIT_BRANCH"
fi fi
# Trigger opam updater # Trigger opam updater
status "[buildjob] Releasing package $OPAM_PKG on opam" status "[buildjob] Releasing package $OPAM_PKG on opam"
...@@ -116,7 +116,7 @@ if [[ -n "$OPAM_PKG" && "$CI_COMMIT_REF_NAME" == "master" ]]; then ...@@ -116,7 +116,7 @@ if [[ -n "$OPAM_PKG" && "$CI_COMMIT_REF_NAME" == "master" ]]; then
-F "token=$OPAM_UPDATE_SECRET" \ -F "token=$OPAM_UPDATE_SECRET" \
-F "ref=master" \ -F "ref=master" \
-F "variables[REPO]=$CI_PROJECT_URL.git" \ -F "variables[REPO]=$CI_PROJECT_URL.git" \
-F "variables[REF]=$CI_COMMIT_REF_NAME" \ -F "variables[REF]=$CI_COMMIT_BRANCH" \
-F "variables[SHA]=$CI_COMMIT_SHA" \ -F "variables[SHA]=$CI_COMMIT_SHA" \
-F "variables[OPAM_PREFIX]=$OPAM_PKG_PREFIX" -F "variables[OPAM_PREFIX]=$OPAM_PKG_PREFIX"
echo # there's no newline here otherwise echo # there's no newline here otherwise
...@@ -129,8 +129,8 @@ if [[ -n "$CI_COQCHK" ]]; then ...@@ -129,8 +129,8 @@ if [[ -n "$CI_COQCHK" ]]; then
fi fi
# maybe generate and upload documentation # maybe generate and upload documentation
if [[ -n "$DOC_DIR" && "$CI_COMMIT_REF_NAME" == "master" ]]; then if [[ -n "$DOC_DIR" && "$CI_COMMIT_BRANCH" == "master" ]]; then
status "Publishing documentation from branch $CI_COMMIT_REF_NAME to $DOC_DIR" status "Publishing documentation from branch $CI_COMMIT_BRANCH to $DOC_DIR"
# check if we have the secret # check if we have the secret
if [[ -z "$DOC_KEY" ]]; then if [[ -z "$DOC_KEY" ]]; then
panic "[buildjob] DOC_KEY variable is missing" panic "[buildjob] DOC_KEY variable is missing"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment