travis-ci/build-stages-demo:.travis.yml@11a4587
sudo: false
jobs:
include:
- stage: unit tests
script: echo one
- stage: unit tests
script: echo two
- stage: deploy to staging
script: skip
deploy: &heroku
provider: heroku
app: sf-stages-staging
api_key: $HEROKU_AUTH_TOKEN
on: sf-stages-demo
- stage: test staging
script: 'curl http://sf-stages-staging.herokuapp.com'
- stage: deploy to production
script: /bin/true
deploy:
<<: *heroku
app: sf-stages-production
- stage: test production
script: 'curl http://sf-stages-production.herokuapp.com'
Build Config
{
"language": "ruby",
"os": [
"linux"
],
"dist": "xenial",
"sudo": false,
"jobs": {
"include": [
{
"stage": "unit tests",
"script": [
"echo one"
]
},
{
"stage": "unit tests",
"script": [
"echo two"
]
},
{
"stage": "deploy to staging",
"script": [
"skip"
],
"deploy": [
{
"provider": "heroku",
"strategy": "api",
"app": "sf-stages-staging",
"api_key": "$HEROKU_AUTH_TOKEN",
"on": {
"branch": [
"sf-stages-demo"
]
}
}
]
},
{
"stage": "test staging",
"script": [
"curl http://sf-stages-staging.herokuapp.com"
]
},
{
"stage": "deploy to production",
"script": [
"/bin/true"
],
"deploy": [
{
"provider": "heroku",
"strategy": "api",
"app": "sf-stages-production",
"api_key": "$HEROKU_AUTH_TOKEN",
"on": {
"branch": [
"sf-stages-demo"
]
}
}
]
},
{
"stage": "test production",
"script": [
"curl http://sf-stages-production.herokuapp.com"
]
}
]
}
}