CircleCI-Public / circleci-packer

Packer Workflows to validate, build and deploy AMIs using CircleCI
Apache License 2.0
42 stars 21 forks source link

deploy-master-canary.sh is missing from this repo #3

Open simonmcc opened 6 years ago

simonmcc commented 6 years ago

deploy-master-canary.sh is referenced in the final step of the canary-snowflake job (https://github.com/CircleCI-Public/circleci-packer/blob/master/.circleci/config.yml#L59), but it's missing from this repo, I've updated a couple of other issues in this example in my own fork & would like to PR the working set when I'm done. Do you have a copy of deploy-master-canary.sh available or can you give me a few pointers on what your intentions for that script were & I'll try & replicate?

bear commented 6 years ago

@simonmcc apologies for the delay in responding!

deploy-master-canary.sh wasn't included because it uses an internal tool, but that doesn't mean we couldn't have included it with that part commented out!

So here is the contents of that script for your PR

#!/bin/bash
set -e

if [[ -z "$CIRCLE_ADMIN_TOKEN" ]]; then
    echo "CIRCLE_ADMIN_TOKEN environment variable must be set"
    exit 1
fi
source scripts/common.sh

if [ "$(base_rebuilt master)" = "true" ]; then
    NAME="master"
    AMI=$(extract_artifact_id $NAME)
    circleci-admin deploy container-server --AMI $AMI
fi