A_the_kunal
A_the_kunal

Reputation: 59

Having a common YAML file for PUSH and TAG based trigger in Google cloud build

I am trying to build a common YAML file for both push and tag-based triggers. I can build two YAML files and pass them to the triggers setting page in Google cloud build, but I want to have a common file for both of them.

In the push trigger, the YAML consists of unit testing and in the tag-based trigger, the YAML consists of unit testing and containerizing the application to be pushed to the artifact registry. As YAML is a text-formatting language and if/else conditions cannot be incorporated in it, how can I do this in one single file?

If you want any other information, please let me know and looking forward to help, thanks in advance

Upvotes: 0

Views: 457

Answers (1)

Zeenath S N
Zeenath S N

Reputation: 1170

You are right, YAML doesn’t support conditional statements, but you can use GitLab to help you parse if statements as mentioned in If condition is possible in YAML file. With the help of this you will be able to add the respective code for Push and tag trigger in the same file.

Upvotes: 1

Related Questions