Skip to content

Commit

Permalink
Eric/goal2 990 pipeline staging area (algorand#332)
Browse files Browse the repository at this point in the history
Added conditionals for SKIP_BUILD and SKIP_DEPLOY
  • Loading branch information
egieseke authored and winder committed Sep 18, 2019
1 parent a72faa6 commit 75c5fd7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/create_and_deploy_recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# create_and_deploy_recipe.sh - Generates deployed network configuration (based on a recipe) and private build and pushes to S3
#
# Syntax: create_and_deploy_recipe.sh -c <channel/network> [-n network] --recipe <recipe file> -r <rootdir> [--nodeploy] [--force] [-m genesisVersionModifier] [ -b <bucket> ]"
# Syntax: create_and_deploy_recipe.sh -c <channel/network> [-n network] --recipe <recipe file> -r <rootdir> [--nodeploy] [--skip-build] [--force] [-m genesisVersionModifier] [ -b <bucket> ]"
#
# Outputs: <errors or warnings>
#
Expand Down Expand Up @@ -39,6 +39,7 @@ NO_DEPLOY=""
FORCE_OPTION=""
SCHEMA_MODIFIER=""
BUCKET=""
SKIP_BUILD=""

while [ "$1" != "" ]; do
case "$1" in
Expand Down Expand Up @@ -72,6 +73,9 @@ while [ "$1" != "" ]; do
shift
BUCKET="$1"
;;
--skip-build)
SKIP_BUILD="true"
;;
*)
echo "Unknown option" "$1"
exit 1
Expand All @@ -97,8 +101,11 @@ if [[ "${NETWORK}" = "" ]]; then
NETWORK=${CHANNEL}
fi

# Build so we've got up-to-date binaries
(cd ${SRCPATH} && make)
# Build binaries
if [[ "${SKIP_BUILD}" != "true" || ! -f ${GOPATH}/bin/netgoal ]]; then
# Build so we've got up-to-date binaries
(cd ${SRCPATH} && make)
fi

# Generate the nodecfg package directory
${GOPATH}/bin/netgoal build -r "${ROOTDIR}" -n "${NETWORK}" --recipe "${RECIPEFILE}" "${FORCE_OPTION}" -m "${SCHEMA_MODIFIER}"
Expand All @@ -107,6 +114,7 @@ ${GOPATH}/bin/netgoal build -r "${ROOTDIR}" -n "${NETWORK}" --recipe "${RECIPEFI
export S3_RELEASE_BUCKET="${S3_RELEASE_BUCKET}"
${SRCPATH}/scripts/upload_config.sh "${ROOTDIR}" "${CHANNEL}"

# Deploy binaries
if [ "${NO_DEPLOY}" = "" ]; then
# Now generate a private build using our custom genesis.json and deploy it to S3 also
${SRCPATH}/scripts/deploy_private_version.sh -c "${CHANNEL}" -f "${ROOTDIR}/genesisdata/genesis.json" -n "${NETWORK}" -b "${S3_RELEASE_BUCKET}"
Expand Down

0 comments on commit 75c5fd7

Please sign in to comment.