This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
112 lines (104 loc) · 2.62 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
variables:
VERSION: "$CI_COMMIT_TAG"
stages:
- build
- deploy
- release
build:
image: maven:3-jdk-11
stage: build
script:
- "mvn clean install"
artifacts:
expire_in: 24 hour
paths:
- target/engine-*.jar
tags:
- s0ra
deploy manual:
image: docker
stage: deploy
dependencies:
- build
environment:
name: development
services:
- docker:19.03.1-dind
when: manual
script:
- "docker build -t registry.gitlab.com/colivery1/colivery-engine:latest ."
- "docker push registry.gitlab.com/colivery1/colivery-engine:latest"
before_script:
- "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY"
after_script:
- "docker logout $CI_REGISTRY"
except:
- develop
- tags
tags:
- s0ra
deploy:
image: docker
stage: deploy
dependencies:
- build
environment:
name: development
services:
- docker:19.03.1-dind
script:
- "docker build -t registry.gitlab.com/colivery1/colivery-engine:${version} ."
- "docker build -t registry.gitlab.com/colivery1/colivery-engine:latest ."
- "docker push registry.gitlab.com/colivery1/colivery-engine:${version}"
- "docker push registry.gitlab.com/colivery1/colivery-engine:latest"
before_script:
- "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY"
after_script:
- "docker logout $CI_REGISTRY"
only:
- develop
tags:
- s0ra
deploy automatically on master:
image: docker
stage: deploy
dependencies:
- build
environment:
name: stage
services:
- docker:19.03.1-dind
script:
- "docker build -t registry.gitlab.com/colivery1/colivery-engine:latest ."
- "docker push registry.gitlab.com/colivery1/colivery-engine:latest"
before_script:
- "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY"
after_script:
- "docker logout $CI_REGISTRY"
only:
- master
tags:
- s0ra
deploy with tags:
image: docker
stage: release
dependencies:
- build
environment:
name: stage
services:
- docker:19.03.1-dind
script:
- "mvn versions:set -DnewVersion=${CI_COMMIT_TAG}"
- "docker build -t registry.gitlab.com/colivery1/colivery-engine:${CI_COMMIT_TAG} ."
- "docker build -t registry.gitlab.com/colivery1/colivery-engine:latest ."
- "docker push registry.gitlab.com/colivery1/colivery-engine:${CI_COMMIT_TAG}"
- "docker push registry.gitlab.com/colivery1/colivery-engine:latest"
before_script:
- "docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY"
after_script:
- "docker logout $CI_REGISTRY"
only:
- tags
tags:
- s0ra