After bamboo spec enablement for repo, any time someone creates a branch on the server, it immediately triggers a build. Even without any commits or code changes. Can we avoid building until an initial commit is pushed?
Before, Bamboo Spec enablement this was working as expected.
Hello @ananda3
Welcome to Atlassian Community!
You can disable automatic branch creation by modifying the Plan settings under Branches:
Create plan branch
( ) Manually
( ) When a pull request is created
( ) When new branch in repository is created
( ) When new branch in repositoru is created and matches expression
Sincerely,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
I think this is not matching with the problem statement, we want to have new branch created but don't want to trigger the build with just new branch creation. We want build to be triggered when there is a commit in the created branch.
Currently, whenever a branch is getting created, it triggers the build in that plan branch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @ananda3
Thank you for providing more details on your request.
Bamboo will trigger a build by default on a Plan Branch creation. There is a Feature Request that covers your scenario, but unfortunately, that is still collecting votes for future implementation. We recommend you vote and watch that FR so you get notified once it move forward on its implementation.
As a workaround, you can add a single script task at the top of the very first Stage of your Plan that will exit if it's the first time the build is happening.
Windows:
if ( ${bamboo.buildNumber} -eq 1 ) {
$host.ui.WriteErrorLine("First build on branch killed to avoid unnecessary build")
exit 1
}
Linux:
if [ ${bamboo_buildNumber} -eq 1 ] ; then echo "First build on branch killed to avoid unnecessary build" exit 1 fi
As a result, the first run after creating a branch will fail immediately and you will avoid unnecessary work.
Sincerely,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Must be buildNumber, not buildnumber (linux example)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.