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
fi
# 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
status "[buildjob] Build performance information"
find -name "*.v.perf" -print0 | xargs -0 cat > build-times.txt
......@@ -87,28 +87,28 @@ if [[ "$CI_RUNNER_DESCRIPTION" == "coop-timing" ]]; then
panic "[buildjob] TIMING_SECRET variable is missing"
fi
# 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 \
--user "$TIMING_SECRET" \
-H "X-Commit: $CI_COMMIT_SHA" \
-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-Date: $(git show $CI_COMMIT_SHA -s --pretty=%cI)" \
--data-binary @- < build-times.txt
fi
# 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
if [[ -z "$OPAM_UPDATE_SECRET" ]]; then
panic "[buildjob] OPAM_UPDATE_SECRET variable is missing"
fi
# determine package name prefix
if [[ "$CI_COMMIT_REF_NAME" == master ]]; then
if [[ "$CI_COMMIT_BRANCH" == master ]]; then
OPAM_PKG_PREFIX=dev
else
OPAM_PKG_PREFIX="branch.$CI_COMMIT_REF_NAME"
OPAM_PKG_PREFIX="branch.$CI_COMMIT_BRANCH"
fi
# Trigger opam updater
status "[buildjob] Releasing package $OPAM_PKG on opam"
......@@ -116,7 +116,7 @@ if [[ -n "$OPAM_PKG" && "$CI_COMMIT_REF_NAME" == "master" ]]; then
-F "token=$OPAM_UPDATE_SECRET" \
-F "ref=master" \
-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[OPAM_PREFIX]=$OPAM_PKG_PREFIX"
echo # there's no newline here otherwise
......@@ -129,8 +129,8 @@ if [[ -n "$CI_COQCHK" ]]; then
fi
# maybe generate and upload documentation
if [[ -n "$DOC_DIR" && "$CI_COMMIT_REF_NAME" == "master" ]]; then
status "Publishing documentation from branch $CI_COMMIT_REF_NAME to $DOC_DIR"
if [[ -n "$DOC_DIR" && "$CI_COMMIT_BRANCH" == "master" ]]; then
status "Publishing documentation from branch $CI_COMMIT_BRANCH to $DOC_DIR"
# check if we have the secret
if [[ -z "$DOC_KEY" ]]; then
panic "[buildjob] DOC_KEY variable is missing"
......
Markdown is supported
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