Skip to content

Instantly share code, notes, and snippets.

@wadewegner
Created March 17, 2018 16:45
Show Gist options
  • Save wadewegner/cd22dbc69b9fa7b0f0f6ed38ed2a652a to your computer and use it in GitHub Desktop.
Save wadewegner/cd22dbc69b9fa7b0f0f6ed38ed2a652a to your computer and use it in GitHub Desktop.
A simple script for testing out pipeline setup
#!/usr/bin/env bash
suffix="12345"
app1="myapp-staging-$suffix"
app2="myapp-prod-$suffix"
pipeline="mypipeline-$suffix"
team="appcloud-dev"
repo="wadewegner/pipelines-demo"
# clean-up script
echo "heroku pipelines:destroy $pipeline
heroku apps:destroy -a $app1 -c $app1
heroku apps:destroy -a $app2 -c $app2
rm -- \"destroy$suffix.sh\"" > destroy$suffix.sh
chmod +x destroy$suffix.sh
heroku apps:create $app1 -t $team
heroku apps:create $app2 -t $team
heroku pipelines:create $pipeline -a $app1 -s staging -t $team
heroku pipelines:add $pipeline -a $app2 -s production
heroku pipelines:connect $pipeline --repo $repo
heroku reviewapps:enable -p $pipeline -a $app1
heroku reviewapps:enable -p $pipeline -a $app1 --autodeploy
heroku reviewapps:enable -p $pipeline -a $app1 --autodestroy
heroku reviewapps:disable -p $pipeline -a $app1 --autodeploy
heroku reviewapps:disable -p $pipeline -a $app1 --autodestroy
heroku reviewapps:disable -p $pipeline -a $app1
heroku reviewapps:enable -p $pipeline -a $app2 --autodeploy --autodestroy
heroku reviewapps:disable -p $pipeline -a $app2 --autodestroy
heroku pipelines:open $pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment