So i am unable to specify this two things togather
build/deploy with these specific conditions.
From a specific branchb : develop And allow to run any branch from web run pipeline button.
Ive tried adding both conditions but this builds non develop branches
my_build:
stage: build
only:
- develop
- web
If i remove web it works only on develop branch but im not allowed to run the job from web button
Has anyone achieved this before ?
Create a new merge request from a source branch with one or more commits. Push a new commit to the source branch for a merge request. Select Run pipeline from the Pipelines tab in a merge request.
If you want the pipeline to run jobs only on commits to a branch that is associated with a merge request, you can use pipelines for merge requests. In the UI, these pipelines are labeled as detached . Otherwise, these pipelines appear the same as other pipelines.
You can set up GitLab CI/CD across multiple projects, so that a pipeline in one project can trigger a downstream pipeline in another project. You can visualize the entire pipeline in one place, including all cross-project interdependencies.
You can do this with the rules
clause, introduced in GitLab 12.3:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
when: manual
$CI_DEFAULT_BRANCH
is what you have set as the default branch in your GitLab repository settings.
See this example repo that a member of the GitLab team created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With