Commit a40190c5 authored by Ralf Jung's avatar Ralf Jung

support submitting timing information

parent dac37b15
......@@ -8,11 +8,15 @@ set -e
## - $OPAM_PINS: Space-separated list of packages to pin in opam, in the format
## "PACKAGE KIND TARGET PACKAGE KIND TARGET ..."
## - $VALIDATE: If non-empty, run `make validate`
## - $OPAM_UPDATE_SECRET, $OPAM_PKG: IF $OPAM_PKG is
## - $OPAM_PKG, $OPAM_UPDATE_SECRET: IF $OPAM_PKG is
## non-empty, release this commit as a new package on opam when done.
## Requires the $OPAM_UPDATE_SECRET variable to be set. This only happens if
## the current branch is $OPAM_PKG_BRANCH, or master if that variable is
## empty.
## - $TIMING_PROJECT, $TIMING_CONF, $TIMING_SECRET: If $TIMING_PROJECT is
## non-empty, submit timing information to coq-speed with the given project
## name and configuration string. Reqires the $TIMING_SECRET variable to be
## set.
# Parepare
. ci/ansi-colors.sh
......@@ -32,6 +36,18 @@ if [[ -n "$VALIDATE" ]]; then
make validate;
fi
# maybe submit timing information
if [[ -n "$TIMING_CONF" ]]; then
echo_color "$BOLDGREEN" "[buildjob] Submitting timing information to coq-speed"
curl --fail -X POST https://coq-speed.mpi-sws.org/webhook/build_times \
-H "X-Commit: $CI_COMMIT_SHA" \
-H "X-Project: $TIMING_PROJECT" \
-H "X-Branch: $CI_COMMIT_REF_NAME" \
-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" == "$MAIN_BRANCH" ]]; then
echo_color "$BOLDGREEN" "[buildjob] Releasing package on opam"
......@@ -42,11 +58,12 @@ if [[ -n "$OPAM_PKG" && "$CI_COMMIT_REF_NAME" == "$MAIN_BRANCH" ]]; then
OPAM_PKG_PREFIX="branch.$CI_COMMIT_REF_NAME"
fi
# Trigger opam updater
curl --fail -X POST -F "token=$OPAM_UPDATE_SECRET" -F "ref=master" \
curl --fail -X POST https://gitlab.mpi-sws.org/api/v4/projects/581/trigger/pipeline \
-F "token=$OPAM_UPDATE_SECRET" \
-F "ref=master" \ # the branch we trigger on the other end
-F "variables[REPO]=$CI_PROJECT_URL.git" \
-F "variables[REF]=$CI_COMMIT_REF_NAME" \
-F "variables[SHA]=$CI_COMMIT_SHA" \
-F "variables[NAME]=$OPAM_PKG" \
-F "variables[OPAM_PREFIX]=$OPAM_PKG_PREFIX" \
https://gitlab.mpi-sws.org/api/v4/projects/581/trigger/pipeline
-F "variables[OPAM_PREFIX]=$OPAM_PKG_PREFIX"
fi
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