-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
41 lines (35 loc) · 1.33 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
36
37
38
39
40
41
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# This template uses jdk8 for verifying and deploying images
image: maven:3.3.9-jdk-8
cache:
paths:
- .m2/repository
stages:
- test
- build
- docker
test-artifact:
image: maven:3.6.0-jdk-8-alpine
stage: test
script:
- mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report
artifacts:
paths:
- weather-forecast-service/target/site/jacoco/jacoco.xml
- weather-forecast-utility/target/site/jacoco/jacoco.xml
build-snapshot-artifact:
image: maven:3.6.0-jdk-8-alpine
stage: build
script:
- mvn clean install -B
artifacts:
expire_in: 7 days
paths:
- weather-forecast-service/target/*.jar
build-docker-image:
stage: docker
image: maven:3.6.0-jdk-8-alpine
script:
- mvn compile -f ${DOCKER_IMAGE_POM} com.google.cloud.tools:jib-maven-plugin:2.5.0:build -Djib.to.auth.username=${CI_REGISTRY_USER} -Djib.to.auth.password=${CI_REGISTRY_PASSWORD} -Djib.to.image=${CI_REGISTRY_IMAGE}