2021-12-24

Show GitLab job in the pipeline when another job contains 'only'

I need to set up .gitlab-ci.yml pipeline so that some jobs are executed everywhere (without only and except) and some, like the Deploy step, only on the master branch. But when I add to Deploy only:, my other Jobs become invisible if the only: property is not specified for them. For example - Test job will be hidden everywhere.

Is there a way to configure GitLab to show Test job anywhere without only/except configuration?

---
stages:
  - Tests
  - Build
  - Deploy

Test:
  stage: Tests

Build:
  stage: Build
  only:
    - master
    - merge_requests

Deploy:
  stage: Deploy
  only:
    - master

Desired Jobs visibility in the pipelines:

  • working branch (and any other pipelines): Tests
  • merge requests: Tests, Build
  • master branch: Tests, Build, Deploy


from Recent Questions - Stack Overflow https://ift.tt/32sauCe
https://ift.tt/eA8V8J

No comments:

Post a Comment