-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
73 lines (63 loc) · 1.66 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
services:
- name: docker:dind
command: [ "--tls=false" ]
variables:
# TESTCONTAINERS_HOST_OVERRIDE: "host.docker.internal"
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: >-
-Dhttps.protocols=TLSv1.2
-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true
MAVEN_CLI_OPTS: >-
--batch-mode
--errors
--fail-at-end
--show-version
--no-transfer-progress
# -DinstallAtEnd=true
INT_TEST_DISABLE: >-
-Dskip.integration.tests=true
INT_TEST_ENABLE: >-
-Dskip.integration.tests=false
image: maven:3-openjdk-8
cache:
paths:
- .m2/repository
stages:
- build
- test
- deploy
deploy:
stage: deploy
script:
- echo "Deploy to staging server"
environment:
name: staging
url: https://staging.example.com
build:
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS install $INT_TEST_DISABLE'
except:
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
test:
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent verify org.jacoco:jacoco-maven-plugin:0.8.8:report $INT_TEST_ENABLE'
needs: ["build"]
artifacts:
when: always
paths:
- liquibase-couchbase/target/site/jacoco/jacoco.xml
reports:
junit:
- liquibase-couchbase/target/surefire-reports/TEST-*.xml
- liquibase-couchbase/target/failsafe-reports/TEST-*.xml
except:
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH