This repository has been archived by the owner on Aug 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
35 lines (30 loc) · 1.85 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
image: maven:3.3.9-jdk-8
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode -P sys-nexus-ci,repo-allow-vaadin -D$SOURCE_PROJ.version=$SOURCE_PROJ_VER"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
TEXT_PLAIN: " text/plain" # welcome to escaping hell
before_script:
- if [ -z "$SOURCE_PIPELINE_ID" ]; then export SOURCE_PIPELINE_ID=$CI_PIPELINE_ID ; fi;
build:
script:
- echo $MAVEN_CLI_OPTS
- curl --request POST "http://cimonitor.craftwater.de/api/v1/jobs/start/$SOURCE_PIPELINE_ID/$CI_PROJECT_ID/$CI_PIPELINE_ID/$CI_JOB_ID"
- echo $SOURCE_PIPELINE_ID
- if [ "$CI_PIPELINE_SOURCE" != "pipeline" ] ; then curl -X POST -u $MAVEN_REPO_USER:$MAVEN_REPO_PASS --header "Content-Type:$TEXT_PLAIN" "https://nexus.craftwater.de/service/siesta/rest/v1/script/maven2/run" -d $SOURCE_PIPELINE_ID ; fi;
# update to new parent pom if there is one
- mvn $MAVEN_CLI_OPTS versions:update-parent -Dpipeline=$SOURCE_PIPELINE_ID -DallowSnapshots=true
- mvn $MAVEN_CLI_OPTS install -Dpipeline=$SOURCE_PIPELINE_ID
- mvn $MAVEN_CLI_OPTS deploy -Dpipeline=$SOURCE_PIPELINE_ID
mutation-testing:
stage: deploy
artifacts:
paths:
- "*/target/pit-reports/*/*"
script:
- mvn $MAVEN_CLI_OPTS test org.pitest:pitest-maven:mutationCoverage -Dpipeline=$SOURCE_PIPELINE_ID
trigger-testbench-jumpstart:
stage: deploy
script:
- export SOURCE_PROJ_VER=`mvn help:evaluate -Dexpression=project.version | grep -Ev '(^\[|Download\w+:)'`
- export SOURCE_PROJ=`mvn help:evaluate -Dexpression=project.artifactId | grep -Ev '(^\[|Download\w+:)'`
- curl --request POST --form "variables[SOURCE_PROJ_VER]=$SOURCE_PROJ_VER" --form "variables[SOURCE_PROJ]=$SOURCE_PROJ" --form "variables[SOURCE_PIPELINE_ID]=$SOURCE_PIPELINE_ID" --form "token=$CI_JOB_TOKEN" --form ref=master https://gitlab.com/api/v4/projects/4950875/trigger/pipeline