diff options
author | Micah Anderson <micah@riseup.net> | 2017-07-25 15:49:46 -0700 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2017-07-26 12:57:59 -0700 |
commit | 55b784f2ccd6336db4bab9157a8498cb87c562ff (patch) | |
tree | 6fe15d2ef55959f63f4f6e9173510ab4dd46857f /tests/platform-ci | |
parent | 66282555344ce203c2372ff78d17610952af76a7 (diff) |
CI: Cleanup and enhance to specify platform branch
Fix indentation; setup some more clear variables.
Add a third variable to ensure the proper platform branch is checked
out. This is necessary because otherwise environment deploys get stuck
because the platform directory is in a detached state and then the
environment deploys will not proceed because the branch check
fails. This will fix #8843.
Diffstat (limited to 'tests/platform-ci')
-rwxr-xr-x | tests/platform-ci/ci-build.sh | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/tests/platform-ci/ci-build.sh b/tests/platform-ci/ci-build.sh index 1445f562..57b874f9 100755 --- a/tests/platform-ci/ci-build.sh +++ b/tests/platform-ci/ci-build.sh @@ -128,18 +128,34 @@ build_from_scratch() { } run() { - echo "Cloning $1 repo: $2" - git clone -q --depth 1 "$2" - cd "$1" - git rev-parse HEAD - echo -n "Operating in the $1 directory: " - pwd - echo "Listing current node information..." - LEAP_CMD list - echo "Attempting a deploy..." - deploy - echo "Attempting to run tests..." - test + provider_name=$1 + provider_URI=$2 + platform_branch=$3 + + # If the third argument is set make sure we are on that platform branch + if [[ -n $platform_branch ]] + then + echo "Checking out $platform_branch branch of platform" + cd "$PLATFORMDIR" + git checkout -B "$platform_branch" + fi + + # Setup the provider repository + echo "Setting up the provider repository: $provider_name by cloning $provider_URI" + git clone -q --depth 1 "$provider_URI" "$ROOTDIR" + cd "$provider_name" + echo -n "$provider_name repo at revision: " + git rev-parse HEAD + echo -n "Operating in the $provider_name directory: " + pwd + echo "Listing current node information..." + LEAP_CMD list + + # Do the deployment + echo "Attempting a deploy..." + deploy + echo "Attempting to run tests..." + test } upgrade_test() { @@ -215,7 +231,7 @@ case "$CI_JOB_NAME" in ;; mail.bitmask.net) TAG='demomail' - run bitmask ssh://gitolite@leap.se/bitmask + run bitmask ssh://gitolite@leap.se/bitmask master ;; demo.bitmask.net) TAG='demovpn' |