From 0a409d5c60490332be5c337a476ee3004923669f Mon Sep 17 00:00:00 2001
From: Ralf Jung <post@ralfj.de>
Date: Sat, 24 Mar 2018 13:37:28 +0100
Subject: [PATCH] use TIMING_SECRET; check if secret variables are missing

---
 buildjob | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/buildjob b/buildjob
index 673145e..d2374da 100755
--- a/buildjob
+++ b/buildjob
@@ -39,7 +39,13 @@ fi
 # maybe submit timing information
 if [[ -n "$TIMING_CONF" ]]; then
     echo_color "$BOLDGREEN" "[buildjob] Submitting timing information to coq-speed"
+    # check if we have the secret
+    if [[ -z "$TIMING_SECRET" ]]; then
+        echo_color "$BOLDRED" "[buildjob] TIMING_SECRET variable is missing"
+    fi
+    # Submit to webhook endpoint
     curl --fail -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" \
@@ -51,6 +57,10 @@ fi
 # maybe create opam package
 if [[ -n "$OPAM_PKG" && "$CI_COMMIT_REF_NAME" == "$MAIN_BRANCH" ]]; then
     echo_color "$BOLDGREEN" "[buildjob] Releasing package on opam"
+    # check if we have the secret
+    if [[ -z "$OPAM_UPDATE_SECRET" ]]; then
+        echo_color "$BOLDRED" "[buildjob] OPAM_UPDATE_SECRET variable is missing"
+    fi
     # determine package name prefix
     if [[ "$CI_COMMIT_REF_NAME" == master ]]; then
         OPAM_PKG_PREFIX=dev
-- 
GitLab