Version 1.0.0
Language EN

Promotions

Drone provides the ability to promote individual commits or tags (e.g. promote to production). When you promote a commit or tag it triggers a new pipeline execution with event type promote. You can use the event type and target environment to limit step execution.

kind: pipeline
name: default

steps:
- name: build
  image: golang
  commands:
  - go build
  - go test

- name: publish
  image: plugins/docker
  settings:
    registry: registry.heroku.com
    repo: registry.heroku.com/my-staging-app/web
  when:
    event: [ promote ]
    target: [ staging ]

- name: publish_to_prod
  image: plugins/docker
  settings:
    registry: registry.heroku.com
    repo: registry.heroku.com/my-production-app/web
  when:
    event: [ promote ]
    target: [ production ]

The above example demonstrates how we can configure pipeline steps to only execute when the promotion matches a specific target environment.

Promoting a Build

Promotions are triggered from the command line utility and are triggered from an existing build number. Note that we plan to enable promoting builds in the user interface in a future release.

drone build promote <repo> <build> <environment>

Promote the specified build number to your staging environment:

drone build promote octocat/hello-world 24 staging

Promote the specified build number to your production environment:

drone build promote octocat/hello-world 24 production

Getting Help

Mailing List
Search for information in the mailing list archives, or post a question.
Chat Support
Real-time chat support from maintainers and community members.