Common build steps for tag and non-tag pushes


#1

I’d like to have the following pipeline for all non-tag pushes:

first-step => second-step => third-step-non-tags

and the following for tag pushes:

first-step => second-step => third-step-tags-only

I’m having a difficult time getting the workflows correct. This is what I have so far:

    workflows:
      version: 2
      pipeline:
        jobs:
          - first-step:
              context: org-global
          - second-step:
              requires:
                - first-step
          - third-step-not-tags:
              context: org-global
              requires:
                - first-step
                - second-step
              filters:
                tags:
                  ignore: /^v.*/
                branches:
                  only: master
          - third-step-tags-only:
              context: org-global
              requires:
                - first-step
                - second-step
              filters:
                tags:
                  only: /^v.*/
                branches:
                  ignore: /.*/

I understand that for any jobs that use tag filtering, the transitively dependent jobs must also use it. But I need those jobs to run for the non-tag pushes as well.

How do I configure my job to be able to do the pipelines I’m looking for?


#2

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.