Is it possible to have a gitlab-ci file wheres a build job defined with the following requirements:
I thought of something like this, but this is poorly false:
build_jar: stage: build script: - echo "build jar" artifacts: paths: - jar/path/*.jar only: - master when: manual
Only solution for me is to have two jobs, one for the master push and one a manual input. But the disadvantage is, that in gitlab it becomes confusingly
In GitLab CI/CD you can easily configure a job to require manual intervention before it runs. The job gets added to the pipeline, but doesn't run until you click the play button on it. Notice that the manual job gets skipped, and the pipeline completes successfully even though the manual job did not get triggered.
To configure a job to be executed only when the pipeline has been scheduled, use the rules keyword.
Fortunately, GitLab CI provides an easy way to run a job in parallel using the parallel keyword. In the background, this creates "clones" of the same job, so that multiple copies of it can run simultaneously.
I also did not find a way to do this in one block and had to use yaml anchors and split into two separate blocks:
.deploy_common: # common config HERE deploy_master_CD: extends: .deploy_common only: refs: - master deploy_manual: extends: .deploy_common when: manual
OR all in one since GitLab 12.3 using rules
deploy: rules: - if: '$CI_COMMIT_REF_NAME == "master"' - when: manual
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