Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def target_profile
- def active_branch = env.BRANCH_NAME
- switch(active_branch) {
- case ~/master/:
- target_profile = "test"
- break
- case ~/dev-.*/:
- target_profile = "test"
- break
- case ~/test-.*/:
- target_profile = "test"
- break
- case ~/staging-.*/:
- target_profile = "staging"
- break
- case ~/canary-.*/:
- target_profile = "canary"
- break
- case ~/prod-.*/:
- target_profile = "prod"
- break
- default:
- sh "echo Branch '${active_branch}' did not meet the naming criteria. Ignoring."
- return
- break
- }
Advertisement
Add Comment
Please, Sign In to add comment