From 35cae109711ba0f99869002bdc9c9da8b679724f Mon Sep 17 00:00:00 2001 From: Scott Charlton Date: Sat, 18 Jan 2020 23:20:39 -0700 Subject: [PATCH] Added .gitlab-ci.yml --- .gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..f8f4b0bb --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,48 @@ +# +# https://code.chs.usgs.gov/coupled/subtrees/phreeqc-COMManuscript-CGfinal-examples-fortran +# +image: buildpack-deps:bionic-scm + +stages: + - trigger + +before_script: + - eval $(ssh-agent -s) + - echo "${SSH_PRIVATE_KEY_ENC}" | base64 --decode | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + - ssh-keyscan ${CI_SERVER_HOST} >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + - git config --global user.email "darth@empire.com" + - git config --global user.name "Darth Vader" + +trigger-downstream: + stage: trigger + ## + ## Only run if on the master branch and the variable GROUP is set + ## + ## change this to + ## only: + ## - master@$GROUP/subtrees/phreeqc-COMManuscript-CGfinal-examples-fortran + ## and set GROUP to coupled before merge + only: + refs: + - master + variables: + - $GROUP + + ## Downstream Projects + ## triggers and ids are stored at the group level + ## iphreeqc https://code.chs.usgs.gov/coupled/iphreeqc + ## iphreeqccom https://code.chs.usgs.gov/coupled/iphreeqccom + ## phreeqc https://code.chs.usgs.gov/coupled/phreeqc + script: + - echo triggering iphreeqc + - curl -X POST -F token=${IPHREEQC_TRIGGER} -F ref=master https://code.chs.usgs.gov/api/v4/projects/${IPHREEQC_ID}/trigger/pipeline + - echo triggering iphreeqccom + - curl -X POST -F token=${IPHREEQCCOM_TRIGGER} -F ref=master https://code.chs.usgs.gov/api/v4/projects/${IPHREEQCCOM_ID}/trigger/pipeline + - echo triggering phreeqc + - curl -X POST -F token=${PHREEQC_TRIGGER} -F ref=master https://code.chs.usgs.gov/api/v4/projects/${PHREEQC_ID}/trigger/pipeline + + ## Upstream Projects + ## none