Issue
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?
Solution
before_script:
- grep -q "SNAPSHOT" pom.xml && exit 1
Answered By - membersound
Answer Checked By - Marie Seifert (JavaFixing Admin)