From 0f9276d4c92e7f2a05c425b12526f52070ae9916 Mon Sep 17 00:00:00 2001 From: blag Date: Thu, 12 Sep 2019 20:38:12 -0700 Subject: [PATCH 1/3] Pull the branches for ST2 and lint-configs from environment variables --- .circle/dependencies | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circle/dependencies b/.circle/dependencies index 51a51253..c55ab769 100755 --- a/.circle/dependencies +++ b/.circle/dependencies @@ -15,10 +15,10 @@ python --version pip --version # Clone st2 repo so other scripts can reference StackStorm Python code -git clone --depth 1 --single-branch --branch master https://github.com/StackStorm/st2.git /tmp/st2 +git clone --depth 1 --single-branch --branch ${ST2_BRANCH} https://github.com/StackStorm/st2.git /tmp/st2 # Clone lint-configs -git clone --depth 1 --single-branch --branch master https://github.com/StackStorm/lint-configs.git ~/ci/lint-configs +git clone --depth 1 --single-branch --branch ${LINT_CONFIGS_BRANCH} https://github.com/StackStorm/lint-configs.git ~/ci/lint-configs # Create a directory for debian packages so we can cache it in Circle CI sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial From ff4f5b38584ff13e2ac7eab597215aee552f1cd4 Mon Sep 17 00:00:00 2001 From: blag Date: Thu, 12 Sep 2019 20:38:48 -0700 Subject: [PATCH 2/3] Use Bash variable reference magic to specify default branches --- .circle/dependencies | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circle/dependencies b/.circle/dependencies index c55ab769..bfd8f730 100755 --- a/.circle/dependencies +++ b/.circle/dependencies @@ -15,10 +15,10 @@ python --version pip --version # Clone st2 repo so other scripts can reference StackStorm Python code -git clone --depth 1 --single-branch --branch ${ST2_BRANCH} https://github.com/StackStorm/st2.git /tmp/st2 +git clone --depth 1 --single-branch --branch ${ST2_BRANCH:-master} https://github.com/StackStorm/st2.git /tmp/st2 # Clone lint-configs -git clone --depth 1 --single-branch --branch ${LINT_CONFIGS_BRANCH} https://github.com/StackStorm/lint-configs.git ~/ci/lint-configs +git clone --depth 1 --single-branch --branch ${LINT_CONFIGS_BRANCH:-master} https://github.com/StackStorm/lint-configs.git ~/ci/lint-configs # Create a directory for debian packages so we can cache it in Circle CI sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial From 4d6dfcd91c0c06caa8299aeba31c1bd33ee0bbe6 Mon Sep 17 00:00:00 2001 From: blag Date: Fri, 13 Sep 2019 01:57:29 -0700 Subject: [PATCH 3/3] Move overridable environment variable to the top of the script --- .circle/dependencies | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circle/dependencies b/.circle/dependencies index bfd8f730..2b1fee90 100755 --- a/.circle/dependencies +++ b/.circle/dependencies @@ -7,6 +7,9 @@ CURRENT_DIR="$(dirname "$0")" export CI_DIR=/home/circleci/ci export PYTHONPATH=/tmp/st2/st2common:${PYTHONPATH} +ST2_BRANCH=${ST2_BRANCH:-master} +LINT_CONFIGS_BRANCH=${LINT_CONFIGS_BRANCH:-master} + git config --global user.name "StackStorm Exchange" git config --global user.email "info@stackstorm.com" @@ -15,10 +18,10 @@ python --version pip --version # Clone st2 repo so other scripts can reference StackStorm Python code -git clone --depth 1 --single-branch --branch ${ST2_BRANCH:-master} https://github.com/StackStorm/st2.git /tmp/st2 +git clone --depth 1 --single-branch --branch "${ST2_BRANCH}" https://github.com/StackStorm/st2.git /tmp/st2 # Clone lint-configs -git clone --depth 1 --single-branch --branch ${LINT_CONFIGS_BRANCH:-master} https://github.com/StackStorm/lint-configs.git ~/ci/lint-configs +git clone --depth 1 --single-branch --branch "${LINT_CONFIGS_BRANCH}" https://github.com/StackStorm/lint-configs.git ~/ci/lint-configs # Create a directory for debian packages so we can cache it in Circle CI sudo rm -rf /var/cache/apt/archives && sudo ln -s ~/.apt-cache /var/cache/apt/archives && mkdir -p ~/.apt-cache/partial