HP4T
Usage
Usage:
hp4t <command> [options]
Commands:
help
- display helpinit <language>
- initialize projectexport <application>
- Export Heroku application configurationexport-pipeline <pipeline>
- Export Heroku pipeline configurationprovision-pipeline
- Configure Heroku pipelinesprovision <environment>
- Configure Heroku applicationdeploy <environment>
- Deploy applicationpromote <environment>
- Promote application to next environmentrun-remote <environment> <command>
- Run command on Herokurun-local <environment> <command>
- Run command locallynotify-rollbar
- Notify Rollbar about deployment
Options:
--branch <branch_name>
- deploy only from a specific branch--tags
- deploy only from tags--slug <slug_name>
- deploy only from specific repository slug
.travis.yml
flow
Example Trunk base development:
language: node_jsnode_js: 6env: global: # ROLLBAR_DEPLOY_KEY - secure: "" # HEROKU_API_KEY - secure: ""cache: apt: true directories: - node_modulesinstall:- npm install- alias hp4t="$(npm bin)/hp4t"before_script:- npm test- hp4t provision-pipeline- hp4t provision stage- hp4t run stage "migrate database"- hp4t deploy stage- hp4t provision production- hp4t promote stage # to production - hp4t run production "migrate database"script:- /bin/trueafter_success:- hp4t notify-rollbar
With feature branch:
language: node_jsnode_js:- 6.0env: global: # ROLLBAR_DEPLOY_KEY - secure: "" # HEROKU_API_KEY - secure: ""cache: apt: true directories: - node_modulesinstall:- npm install- alias hp4t="$(npm bin)/hp4t"before_script:- npm test- hp4t provision-pipeline- hp4t provision stage- hp4t run stage "migrate database"- hp4t deploy stage- hp4t provision production- hp4t promote stage # to production - hp4t run production "migrate database"- hp4t deploy featureX --branch featureXscript:- /bin/trueafter_success:- hp4t notify-rollbar
Continuous delivery (deploy on tag):
language: node_jsnode_js:- 6.0env: global: # ROLLBAR_DEPLOY_KEY - secure: "" # HEROKU_API_KEY - secure: ""cache: apt: true directories: - node_modulesinstall:- npm install- alias hp4t="$(npm bin)/hp4t"before_script:- npm test- hp4t provision stage --branch develop- hp4t run stage "migrate database" --branch develop- hp4t deploy stage --branch develop- hp4t provision production --tags --branch master- hp4t deploy production --tags --branch master # to production - hp4t run production "migrate database" --tags --branch master- hp4t deploy featureX --branch featureXscript:- /bin/trueafter_success:- hp4t notify-rollbar
Configuration
File: .hp4t.yaml
, format YAML.
Example:
infrastructure:- dir: infrastructure/environments: default: - slug: wojtekk/hp4t - branch: master stage: - app: app_name-stage - branch: develop - tags: false production: - app: app_name - branch: master - tags: true