cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Continuous Integration and Delivery - Dynamic step execution

0 Likes
570

Hello,

I have two branches in my git repository (main & dev) and i want to execute the release stage only in the branch main.

In CI/CD service i configured two jobs, one by branch. And both are configured in Source Repository mode.

Do you have any idea how to execute the stage only when the branch is main ?

I'm able to do it if i configured for example main in source repo and dev in job editor, but it's not what i want.

Regards,

Nicolas

Accepted Solutions (0)

Answers (1)

Answers (1)

LindaSieb84
Product and Topic Expert
Product and Topic Expert

Hi Nicolas,

As you're using two different branches, you can have a different version of the .pipeline/config.yml file in each branch. If you have a job running the main branch, it will run whatever is in the .pipeline/config.yml file in the main branch, and the same is true for the dev branch.

If you're unsure how to set up the .pipeline/config.yml file, I would recommend using the Job Editor Configuration mode just for help with generating a config.yml file that you can then copy and upload to your repository in the correct branch.

Just don't forget to switch back to Source Repository Configuration mode after :).

Something to note though is that with this approach you would then need to add the .pipeline/config.yml file to your .gitignore file so that you don't change the main branch's file each time you merge a dev branch into main.

I'll talk with my team to see what other options we have here, but for now I hope that was helpful!

Best regards,

Linda