-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (45 loc) · 1.29 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
image: maven:3.9.6-eclipse-temurin-21-alpine
stages:
- build
- test
- deploy
before_script:
- apk add --no-cache chromium
- export CHROME_BIN=/usr/bin/chromium-browser
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"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- .m2/repository/
- target/
- node/
- app/node_modules/
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS compile
test:
stage: test
script:
- mvn $MAVEN_CLI_OPTS test
verify:
stage: test
script:
- mvn $MAVEN_CLI_OPTS verify
except:
- master
# To deploy packages from CI, create a ci_settings.xml file
# For `master` branch run `mvn deploy` automatically.
deploy:
stage: deploy
script:
- if [ ! -f ci_settings.xml ];
then echo "CI settings missing\!";
fi
- 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml'
only:
- master