Skip to content

allow using buildback in CI tests #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ ENV_DIR="$3"
# load required environment variables
GIT_REPO_URL=$(<"$ENV_DIR/GIT_REPO_URL")
GIT_SSH_KEY=$(<"$ENV_DIR/GIT_SSH_KEY")
SOURCE_VERSION=$(<"$ENV_DIR/SOURCE_VERSION")
CI=$(<"$ENV_DIR/CI")
HEROKU_TEST_RUN_BRANCH=$(<"$ENV_DIR/HEROKU_TEST_RUN_BRANCH")
HEROKU_BRANCH=$(<"$ENV_DIR/HEROKU_BRANCH")

if [[ -z $GIT_REPO_URL ]]; then
echo "Did you forget to set GIT_REPO_URL?"
Expand Down Expand Up @@ -50,7 +54,17 @@ echo "-----> Installed SSH key from GIT_SSH_KEY"

# checkout the revision that's being deployed
git fetch -q --depth 1 origin -a > /dev/null
git checkout -q ${SOURCE_VERSION:-master} > /dev/null
if [ $CI ]
then
git checkout -q ${HEROKU_TEST_RUN_BRANCH:-master} > /dev/null
else
if [ $HEROKU_BRANCH ]
then
git checkout -q ${HEROKU_BRANCH:-master} > /dev/null
else
git checkout -q ${SOURCE_VERSION:-master} > /dev/null
fi
fi
echo "-----> Fetched shallow history from $GIT_REPO_URL"

# initialize all the submodules
Expand Down