xtra
xtra

Reputation: 2372

Will Gitlab trigger all jobs that listen on a branch change when I run pipeline manually

I have a pipeline that contains several jobs triggered by changes on a branch:

deployDev:
  only:
    - dev
  script:
    - ...

deployProd:
  only:
    - master
  script:
    - ...

If I now hit the "Run pipeline" button in the GitLab UI, will it trigger these jobs or will it only trigger the jobs that specify when:manual ?

And how can I make sure that deployDev and deployProd do not run when I run a manual deploy?

I have checked here: https://docs.gitlab.com/ee/ci/yaml/#onlyexcept-basic, but I'm unsure.

Upvotes: 0

Views: 692

Answers (2)

Rekovni
Rekovni

Reputation: 7384

I'm a bit confused what you are trying to achieve from your comment as well, however...

If I now hit the "Run pipeline" button in the GitLab UI, will it trigger these jobs or will it only trigger the jobs that specify when:manual ?

As @Prashanna has said, It'll run all jobs corresponding to the branch and will wait for manual action for manual jobs.

If you do not want deployDev and deployProd to appear in the Pipeline when pressing the Run Pipeline button, you can use:

  only:
    - master
  except:
    - web

from the link you showed https://docs.gitlab.com/ee/ci/yaml/#onlyexcept-basic: web -

For pipelines created by using Run pipeline button in the GitLab UI, from the project’s CI/CD > Pipelines section.

The above job would then only appear in the Pipeline, when it is the master branch, and when it has not been triggered by the Run Pipeline button.

Upvotes: 1

Prashanna
Prashanna

Reputation: 1001

It'll run all jobs corresponding to the branch and will wait for manual action for manual jobs.

So your deploydev will run against your development pipeline and other job will run only in production pipeline

Upvotes: 1

Related Questions