This repository has been archived by the owner on Aug 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deploy.sh use current branch/tag for atlas build.
- Loading branch information
Thom Toogood
committed
Feb 15, 2016
1 parent
a648e11
commit 289be7a
Showing
5 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
#!/bin/bash -eu | ||
#!/bin/bash -e | ||
|
||
# Set default environment variables. | ||
ATLAS_BOX="$BEET_BOX-dev" | ||
BEET_VERSION=${BEET_VERSION:-"0.1.$CIRCLE_BUILD_NUM"} | ||
ATLAS_VERSION=${BEET_VERSION:-"0.1.$CIRCLE_BUILD_NUM"} | ||
BEET_VERSION=${CIRCLE_BRANCH:-"dev"} | ||
BEET_TEMPLATE=${BEET_TEMPLATE:-"template.json"} | ||
PACKER_HOME=${PACKER_HOME:-"~/$CIRCLE_PROJECT_REPONAME/provisioning"} | ||
PACKER_HOME=${PACKER_HOME:-"$BEET_HOME/provisioning"} | ||
|
||
# Use prod atlas build and tag for version. | ||
if [ $CIRCLE_TAG ]; then | ||
if [ ! $CIRCLE_TAG = "" ]; then | ||
ATLAS_BOX="$BEET_BOX" | ||
ATLAS_VERSION="$CIRCLE_TAG" | ||
BEET_VERSION="$CIRCLE_TAG" | ||
fi | ||
|
||
cd $PACKER_HOME | ||
|
||
# Update template variables. | ||
sed -i "s/ATLAS_VERSION/$ATLAS_VERSION/" $BEET_TEMPLATE | ||
sed -i "s/BEET_VERSION/$BEET_VERSION/" $BEET_TEMPLATE | ||
|
||
# Trigger new build. | ||
cd $PACKER_HOME ; packer push -token=$ATLAS_TOKEN -name="$ATLAS_BOX" $BEET_TEMPLATE | ||
packer push -token=$ATLAS_TOKEN -name="$ATLAS_BOX" $BEET_TEMPLATE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters