Puppet Forge Deployment

This page documents deployments using dpl v1 which currently is the default version. The next major version dpl v2 will be released soon, and we recommend starting to use it. Please see our blog post for details. dpl v2 documentation can be found here.

Travis CI can automatically deploy your modules to Puppet Forge or to your own Forge instance after a successful build.

To deploy to Puppet Forge, add your Puppet Forge username and your encrypted Puppet Forge password to your .travis.yml:

deploy:
  provider: puppetforge
  user: "<Your username>"
  password:
    secure: "YOUR ENCRYPTED PASSWORD"

Deploying to a custom forge #

To deploy to your own hosted Forge instance by adding it in the url key:

You can explicitly set the name via the app option:

deploy:
  provider: puppetforge
  user: "<Your username>"
  password:
    secure: "YOUR ENCRYPTED PASSWORD"
  url: https://forgeapi.example.com/

Running commands before and after deploy #

Sometimes you want to run commands before or after deploying. You can use the before_deploy and after_deploy stages for this. These will only be triggered if Travis CI is actually deploying.

before_deploy: "echo 'ready?'"
deploy:
  ..
after_deploy:
  - ./after_deploy_1.sh
  - ./after_deploy_2.sh