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
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