Skip to content

Instantly share code, notes, and snippets.

@mprokopov
Created May 5, 2020 09:12
Show Gist options
  • Select an option

  • Save mprokopov/497455a1d405b1368a7a4f2a127d9df4 to your computer and use it in GitHub Desktop.

Select an option

Save mprokopov/497455a1d405b1368a7a4f2a127d9df4 to your computer and use it in GitHub Desktop.
Use when command to deploy develop branch to the QA (target VM) and master branch to deploy to the Production (k8s VM).
Enhance existing ansible deployment pipeline to be environment specific
- add two inventories to the ansible: QA and prod
- change Jenkinsfile to use $BRANCH variable to select inventory.
- using when directive make deployment conditional
develop branch -> target VM
master branch -> k8s VM
other branch -> nowhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment