-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (51 loc) · 1.44 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
image: maven:latest
stages:
- build
- test
- deploy
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"
compile-job:
stage: build
script:
- 'mvn clean compile'
artifacts:
paths:
- target/staging
unittest-job:
stage: test
script:
- 'mvn test'
dependencies:
- compile-job
artifacts:
paths:
- target/staging
createjar-job:
stage: deploy
script:
- 'mvn assembly:single'
dependencies:
- unittest-job
only:
- master
artifacts:
paths:
- /builds/programvareutvikling-v19/gruppe-16/target/PU16-BookBoard 1.0.1-jar-with-dependencies.jar
# most of this taken from https://stackoverflow.com/questions/37785154/how-to-enable-maven-artifact-caching-for-gitlab-ci-runner
#cache:
# paths:
# - .m2/repository
# keep cache across branch
# key: "$CI_BUILD_REF_NAME"
#variables:
# MAVEN_OPTS: "-Djava.awt.headless=true -Dmaven.repo.local=.m2/repository"
# MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -Dgitlab-ci=true"
#build:
# script:
# - mvn $MAVEN_CLI_OPTS compile
#test:
# stage: test
# script:
# - mvn $MAVEN_CLI_OPTS test