-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
.gitlab-ci.yml
70 lines (66 loc) · 1.3 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
stages:
- setup
- test
- build
- deploy
prepare:
stage: setup
image: maven:3.3.9-jdk-8
tags:
- docker
cache:
key: maven:v1
paths:
- ./m2Repository
script:
- cp ./config/docker/settings.xml /root/.m2/settings.xml
- mvn dependency:resolve -B -U
test:
stage: test
image: maven:3.3.9-jdk-8
tags:
- docker
cache:
key: maven:v1
paths:
- ./m2Repository
dependencies:
- prepare
script:
- cp ./config/docker/settings.xml /root/.m2/settings.xml
- mvn test -B
build:
stage: build
image: maven:3.3.9-jdk-8
tags:
- docker
cache:
key: maven:v1
paths:
- ./m2Repository
artifacts:
paths:
- ./target/wildbook-6.0.0-EXPERIMENTAL.war
expire_in: 1 week
dependencies:
- test
script:
- cp ./config/docker/settings.xml /root/.m2/settings.xml
- mvn clean install -DskipTests -Dmaven.javadoc.skip=true -B
deploy-container:
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
tags:
- docker
stage: deploy
dependencies:
- build
services:
- docker:dind
before_script:
- docker info
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build -t $DOCKER_ORG/wildbook:latest -f config/docker/Dockerfile .
- docker push $DOCKER_ORG/wildbook:latest