I want to evaluate in my gitlab_ci
pipeline if the current java
project is to build with a SNAPSHOT
dependency inside the maven
pom.xml
:
Like so: grep -q "SNAPSHOt" pom.xml && echo 1
Question: how could I integrate this into a ci pipeline so that the pipeline does not even execute if this condition is true?
gitlab_ci.yml
:
image: docker:20
build:
stage: build
script:
- mvn package...
Where would I add that sort of condition check, and how could I then let the full job fail?
2
Answers
not satisfied you can just check the condition in
script
and thenuse
exit some_non_zero number
.eg:
Here for condition i have used
1==1
.