Skip to content

Instantly share code, notes, and snippets.

@7vs
Forked from tiagopog/heroku_pipelines.md
Created November 6, 2017 16:54
Show Gist options
  • Save 7vs/1686200cc60eada0639284968d8c4da1 to your computer and use it in GitHub Desktop.
Save 7vs/1686200cc60eada0639284968d8c4da1 to your computer and use it in GitHub Desktop.
Heroku Pipelines CLI

Pipelines

Many Pipelines operations can be performed via the CLI, which requires the Pipelines plugin for the Heroku Toolbelt. To install:

% heroku plugins:install heroku-pipelines
% heroku help pipelines
% heroku apps:create une-pipe-staging
% git remote add staging [email protected]:une-pipe-staging.git
% config:set RACK_ENV=staging -r staging
% heroku config -r staging
% heroku apps:create une-pipe-production
% git remote add production [email protected]:une-pipe-production.git
% heroku config:set RACK_ENV=production -r production
% heroku config -r production
% heroku pipelines:create -a pipeline-name
% heroku pipelines:add -a app-name-staging pipleline-name
? Stage of app-name-staging: staging
Adding app-name-staging to pipeline-name pipeline as staging... done
// To deploy to production:
% heroku pipelines:promote -r staging
Fetching app info... done
Fetching apps from nest-pas-une-pipe... done
Starting promotion to production... done
Waiting for promotion to complete... done

Promotion successful
Une-Pipe-Production: succeeded

Github Sync and Reviews

Heroku, when connected to GitHub, can be configured to automatically or manually create development-stage apps in the pipeline. It will track a PR and keep the app updated as you commit to that branch and fire a rebuild.

review ---> staging ---> prod

On Heroku app dashboard:

  1. Under deploy/ select the Github tab
  2. Connect to Github repo
  3. There is an option to automatic deploys
  4. Under Review apps section, enable that option
  5. Select option to Create new review apps for new pull requests automatically

Gotchas

app.json

app.json is a manifest format for describing web apps. It declares environment variables, add-ons, and other information required to run an app on Heroku.

{
  "name":"nest-pas-une-pipe",
  "scripts":{},
  "env":{},
  "addons":[]
}

Application names

Can only be up to 30 characters long, or you will get a review app build error

Links

Trello:

Ref:

Questions

  • Assets
  • Post deploy scripts
  • Anything else that should be in app.json?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment