How to override the default plan branch configuration? - bamboo

Currently we are in the process of migrating our projects from jenkins to bamboo. In this process, I am looking for an option in bamboo plan for a plan branch to be created when a new branch is created in the bitbucket repo and also when pull request is created.
As I see in the branch configuration of a plan, it is possible only to choose one option (new branch or pull request) for plan branch. is there any way where i can choose both options? Can I override the configuration using shell script? our bamboo server is currently running version 6.10.

Bamboo doesn't support multiple options for plan branch creation. What's the reason to have both options?
Before you create PR VCS branch already exists so why option to create plan branch on Bitbucket branch creation is not enough?

Related

TeamCity : Exclude merge request build from a specific branch

I have a merge request build job in TeamCity, which runs whenever there is a merge request to any branch in Gitlab.
We have got different branches such as Production, staging, edge & testing.
The VCS Configuration is given below
I want to exclude this job for any merge request to the testing branch in Gitlab.
Which TeamCity version are you using? Latest version (2022.04.4) allows to filter MRs via target branch

Can I deploy bamboo.yml YAML specs manually?

I am trying to learn how YAML specs works in Bamboo. So far I achieved to deploy the plan following the official documentation. enter link description here
The documentation explains that you need to create a bitbucket repository, create bamboo.yml, set a new project in bamboo, enable a bamboo specs repository and finally you get your plan created and based in YAML specs.
My question is, can I create a plan.yml and deploy it from other bamboo plan?
For example, for JAVA specs, it is enough to checkout a repo with several *.java specs files and use maven and a pom file to deploy all the plans.
Can I do something similar with YAML specs? To have a folder in some SCM with several *.yml files and deploy them simultaneously. As a result, to have a lot of plans in bamboo deployed and based on the yml files.
yes and no, yaml can't be sent to the server as you can do with java specs. It needs to be committed to the repo first
you also need to have your different project created prior to committing the yaml specs and or have that repo granted access to each individual project or enabled the flag on the linked repo to allow access to all projects in the specs tab.
if this is not an issue,then yes there is no problem defining multiple plans in your bamboo specs yml file, even across multiple projects, as long as they are split up in separate yaml documents (with "---")

Bamboo does not automatically create branch in the plan

Bamboo:
On my current build plan I've checked an option create branch plan when new branch in repository is created and matches expression and set value hotfix*
Repository from the Bitbucket is of course linked to this build plan.
Bitbucket:
I have created branch named hotfix/test in Bitbucket git repository and set Bamboo plan branch.
After several hours branch was not automatically created and I have no idea what do I wrong.
I've resolved this by making the following changes:
Changed match pattern from hotfix* to hotfix/.*
Be also sure, that new hotfix repository you're creating in Bitbucket doesn't have activity older than you've set in other option Delete plan branch - After branch inactivity in repository.

How to use one sourceode checkout for all the Bamboo stages?

I am planning to create 4 stages
Source code checkout stages
Build for dev env stages
Build for uat env stages
Build for Prod env stages
Is it possible to use the same source code check out for all the stages? How?
This is actually straight forward:
Define your repository in the Repository tab of the plan configuration
Add a Sourcecode Checkout task for each build job in the plan.
By virtue of the repository definition for the plan, a consistent snapshot at the time the plan was started, will be used for the checkout tasks i.e. they will each fetch the same code.
This is not clearly documented in the Bamboo docs but is discussed here https://answers.atlassian.com/questions/33651/stages-and-artifact-passing
Above answer works, but I think you should not build same branch with all environments. It might be better to use better branching workflow,so that you can easily deploy correct change to required environment.

How to select the particular repository in bamboo during build?

I am new to use the bamboo server. In the application, i have multiple branches, during the build time, it is possible to normal user to select the particular branch to build other than default repository.
Thanks in advance
You can use plan branches to build for specific or all branches. See https://confluence.atlassian.com/display/BAMBOO/Using+plan+branches for more details.