-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
75 lines (69 loc) · 1.95 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
74
75
stages:
- build
- sonar
- release
- update-version
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: "-s .m2/settings.xml --batch-mode"
cache:
key: one-key-to-rule-them-all
paths:
- .m2/repository
build:
stage: build
script: mvn $MAVEN_CLI_OPTS test
image: "maven:3.6.0-jdk-8-alpine"
tags:
- mvn
artifacts:
name: "toolchain-fixtures"
expire_in: 1 hour
paths:
- target/*
except:
- development
- master
sonar:
stage: sonar
script: mvn sonar:sonar -Dsonar.projectKey=toolchain-fixtures -Dsonar.host.url=$SONAR_ENDPOINT -Dsonar.login=$SONAR_LOGIN
image: "maven:3.6.0-jdk-8-alpine"
tags:
- mvn
except:
- development
- master
release:
stage: release
script:
- apk add --no-cache gnupg
- export GNUPGHOME=.gnupg
- echo "${GPG_KEY}" | gpg --batch --import
- mvn $MAVEN_CLI_OPTS versions:set -DremoveSnapshot
- mvn $MAVEN_CLI_OPTS -P release -DskipTests -Dgpg.passphrase=${GPG_PASS} deploy
image: "maven:3.6.0-jdk-8-alpine"
artifacts:
name: "toolchain-fixtures"
expire_in: 1 week
paths:
- target/*
only:
- master
tags:
- mvn
update-version:
stage: update-version
image: "maven:3.6.0-jdk-8-alpine"
script:
- apk update && apk upgrade && apk add --no-cache bash git openssh
- git config --global user.email "[email protected]"
- git config --global user.name "macmini"
- git checkout -B "$CI_BUILD_REF_NAME"
- mvn -B $MAVEN_CLI_OPTS release:update-versions -DautoVersionSubmodules=true
- git add '*pom.xml'
- git commit -m "update version [ci skip]"
- git push https://$MACMINI_USER:[email protected]/praegus/toolchain-fixtures/toolchain-fixtures.git
only:
- master
tags:
- mvn