mibexsoftware / bamboo-plan-dsl-plugin

Configuration as code with a Groovy-based DSL or YAML for Atlassian Bamboo.
https://marketplace.atlassian.com/plugins/ch.mibex.bamboo.plandsl/
Other
40 stars 16 forks source link

Triggers. Issue with afterSuccessfulBuildPlan() setting customPlanBranchName option #88

Open strakh-alex opened 6 years ago

strakh-alex commented 6 years ago

I am trying to create deployment trigger via DSL which triggers on afterSuccessfulBuildPlan() event. If I specify customPlanBranchName (develop) option I receive next error: Plan DSL: task failed: Plan with key 'SPR-SPRAT0' not found If I don't specify this option - plan is successfully creating. Also I notified next strings in logs: Plan DSL: plan branch mapping SPR-SPRAT-develop = SPR-SPRAT0 Plan DSL: plan branch mapping SPR-SPRAT-master = SPR-SPRAT2 My project has name SPR-SPRAT. Where did these numbers come from?

mrueegg commented 5 years ago

@strakh-alex Please excuse my late response. Could you please provide me a minimal example DSL so that I'm able to reproduce it? Thanks, Michael

strakh-alex commented 5 years ago

Hi @mrueegg. It looks like this: triggers { afterSuccessfulBuildPlan() { description 'After Successful Build Plan' /if(env.name == 'DEV' || env.name == 'SIU') { customPlanBranchName 'develop' }/ } }

If I uncomment condition - the issue will appear. With comments all works.

ashokgadeking commented 5 years ago

afterSuccessfulBuildPlan() works for me only on the main branch of the Build Plan.

This works, sets the branch to default branch. Master, in my case.

            environment(name: 'PRODUCTION', id: 1) {
                description 'PRODUCTION-RELEASE'
                triggers {
                    afterSuccessfulBuildPlan() {
                        description 'Master Plan Branch Trigger'
                        //no branch definition
                    }
                }
            } 

Custom plan branch does not work, I tried using the plan branch key generated by Bamboo instead of the branch name as well.

            environment(name: 'PRODUCTION', id: 1) {
                description 'PRODUCTION-RELEASE'
                triggers {
                    afterSuccessfulBuildPlan() {
                        description 'Develop Plan Branch Trigger'
                        customPlanBranchName 'develop'
                    }
                }
             }