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

Repository not enabled in build trigger #64

Closed lseek closed 6 years ago

lseek commented 6 years ago

I define the following seed task (inline):

project(key: 'DEV', name: 'DEVOPS') {
    def newPlan = plan(key: 'TRIGGERTEST', name: "triggertest") {
        description 'Test build triggering'
        enabled false

        scm {
          linkedRepository('testrepo')
        }

        triggers {
          bitbucketServerRepositoryTriggered {
          }
        }

        branches {
            autoBranchManagement {
                newPlanBranchesForMatchingBranchNames('review/.*')
                deletePlanBranchesAfterDays(5)
                deleteInactivePlanBranchesAfterDays(3)
            }
            merging {
                branchUpdater {
                    mergeFromBranch "DEV-TRIGGERTEST"
                    pushEnabled true
                }
            }
        }

        stage(name: 'Default Stage') {
            description 'Run Tests'

            job(key: 'JOB1', name: 'Run test') {
                description 'Run Test'
                enabled true

                tasks {
                    checkout {
                        description 'Checkout Default Repository'
                        repository(name: 'testrepo') { }
                    }
                    script {
                        description 'Run test'
                        inline {
                            scriptBody '''\
                              #!/bin/bash

                              echo Testing'''.stripIndent()
                        }
                    }
                }
            }
        }
    }
}

When I run this task the plan gets created successfully. When I go over to the "Triggers" tab it shows a "Bitbucket Server repository triggered" entry (as expected). But if I select that entry I see the entry for my repository (testrepo) is NOT selected. As a result the build plan doesn't get triggered on changes - I have to rely on a periodic poll to trigger builds.

Bamboo version: 6.1.0 build 60103 - 18 Jul 17

Not sure if it is related to https://github.com/mibexsoftware/bamboo-plan-dsl-plugin/issues/40

mrueegg commented 6 years ago

Thanks for your feedback. You're right, since version 1.9.2 of the plug-in, we require that a user specifies which repositories should trigger the plan like follows:

bitbucketServerRepositoryTriggered {
        description 'run when new code'
        repositories 'REPO1', 'REPO2'
}

We have fixed this in 1.9.5 so that if you don't specify which repositories should trigger the plan, then all the plan's Bitbucket Server repositories will do. So either you specify the repositories like shown above, or you upgrade to 1.9.5 and it should working again. Hope that helps!