-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
42 lines (36 loc) · 871 Bytes
/
.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
image: maven:3-openjdk-17
variables:
MVN_REPO: $CI_PROJECT_DIR/maven-repo
ARTIFACT_JAR_NAME: gitlab-tools.jar
cache:
paths:
- $MVN_REPO/
stages:
- test
- integration-test
- deploy
test:
stage: test
script:
- mvn test -B -Dmaven.repo.local=$MVN_REPO
integration-test:
stage: integration-test
services:
- name: docker:dind
command: ["--tls=false"]
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
script:
- mvn verify -B -DskipUnitTests -Dmaven.repo.local=$MVN_REPO
deploy:
stage: deploy
script:
- mvn deploy -B -DskipTests -s ci_settings.xml -Dmaven.repo.local=$MVN_REPO
- mv target/*-jar-with-dependencies.jar target/$ARTIFACT_JAR_NAME
artifacts:
paths:
- target/$ARTIFACT_JAR_NAME
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH