We encounter a problem when we need to perform one specific task in gitlab CI. We do not currently know how to solve this problem. We have multi-line tasks defined in ours .gitlab-ci.yml, but we only need to complete one task in our conveyors. How can you just start a single task, for example? job1or job2? We cannot use tagsor branchesas a software switch in our environment.
.gitlab-ci.yml
job1
job2
tags
branches
before_script: - docker info job1: script: - do something job2: script: - do something
, "" CI - GitLab CI. GitLab CI , . . , . , tags, commit messages branches .
commit messages
. . , . .
when: manual , .
when: manual
- , , - "" -, , .
: https://docs.gitlab.com/ce/ci/yaml/README.html#when
- "", , job1, job2 , only except : https://docs.gitlab.com/ce/ci/yaml/README.html#only-and-except
only
except
, .
job 1
job 2
job 4
job3
job 3
helloTag.1
helloTag.2
helloTag.3
develop master ( ), 3 ( 1, 2, 4)
develop
master
Please note that the third task is not in the pipeline
Go to "Repository" → "Tags" → "New Tag"
Give the tag a name that matches your regular expression significantly
If we are in a tag with a name that begins with "helloTag.", We will have 1 stage (stage 3)
Please note that no other steps are present here.
.gitlab-ci
stages: - myStage1 - myStage2 - myStage3 - myStage4 This is my first stage: stage: myStage1 before_script: - echo "my stage 1 before script" script: - echo "my stage 1 script" except: - /^helloTag.*$/ This is my second stage: stage: myStage2 before_script: - echo "my stage 2 before script" script: - echo "my stage 2 script" except: - /^helloTag.*$/ This is my third stage: stage: myStage3 before_script: - echo "my stage 3 before script" script: - echo "my stage 3 script" only: - /^helloTag.*$/ This is my fourth stage: stage: myStage4 before_script: - echo "my stage 4 before script" script: - echo "my stage 4 script" except: - /^helloTag.*$/
Hope this helps you.
Source: https://habr.com/ru/post/1015976/More articles:Как изменить логическое значение при щелчке в angular 2 компонента - javascriptРазличия между использованием Lex и Alexa - amazon-web-servicesEntity Framework Core + SQlite. Asynchronous requests are actually synchronous - c #Не удалось подключиться к MarkLogic через ODBC на CentOs - odbcGradle indentation problem in Android Studio 2.3 - androidRedraw multiple paths in the same positions from the previous layout orientation - androidthe onbeforeunload confirmation dialog is not displayed when angular2 @HostListener is used - angularSupport for two languages in the travis.ci file - travis-ciAngular 2 and Angular Cli tree building assembly, vendor.js huge - angularWhat is CSS color name: background? - cssAll Articles