1

I am using Bamboo specs to configure my Bamboo plans. Now my configuration is using plan branches and for each new branch the configuration is applied:

branches:
  create: for-new-branch

Now I have jobs running configured like that:

stages:
  - Stage A:
    manual: false
    final: false
    jobs:
      - Job A
      - Job B
      - Job C

What I now want to have is that Job C only executes (and is also only shown in the Job list) when the build is running on branch "develop". On the other branches this job shouldn't even be in the list of jobs.

What I currently have is, that I conditionally exclude the task inside the job from being run on branches other than develop.

  - script:
      interpreter: BINSH_OR_CMDEXE
      file: scripts/build/myjobscript.sh
      working-dir: dev
      conditions:
        - variable:
            equals:
              planRepository.branch: develop

With this solution the job is present in each branch, just not executing the task script. Is there a better solution?

Thanks for your input!

  • Unfortunately I found out that there is already a ticket open at atlassian for this topic. See https://jira.atlassian.com/browse/BAM-11257. Currently it is *not* possible to make jobs (not tasks) conditonal! – Alexander Ende Oct 21 '21 at 13:43

0 Answers0