-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
95 lines (83 loc) · 1.65 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.base:
except:
- /^(wip|test).*$/
variables:
CONTAINER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stages:
- test
- build
- staging
- integrationTest
- deploy
clean:
extends: .base
stage: build
script:
- ./gradlew clean
test:
extends: .base
stage: test
script:
- ./gradlew clean
- ./gradlew test -i
artifacts:
when: always
reports:
junit: [build/test-results/test/TEST-*.xml]
lint:
extends: .base
stage: test
script:
- ./gradlew ktlintCheck
allow_failure: true
war:
extends: .base
stage: build
script:
- ./gradlew war
- cp ./build/libs/tepid*.war ~/tepid.war
artifacts:
when: always
paths:
- ./build/libs/tepid*.war
build docker:
extends: .base
stage: build
tags:
- docker-build
before_script:
- sudo -g docker docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- sudo -g docker docker build -t $CONTAINER_IMAGE -t $CI_REGISTRY_IMAGE:test .
- sudo -g docker docker push $CI_REGISTRY_IMAGE
deploy test:
extends: .base
stage: staging
tags:
- docker-build
script:
- /deploy.sh tepid test
integrationTest:
extends: .base
stage: integrationTest
script:
- ./gradlew clean
- ./gradlew test -i
- ./gradlew integrationTest -i
artifacts:
when: always
reports:
junit: [build/test-results/integrationTest/TEST-*.xml]
deploy:
extends: .base
stage: deploy
tags:
- docker
only:
- dev
- master
before_script:
- sudo -g docker docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- cd $COMPOSE_DIR
- sudo -g docker docker-compose up -d