-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
32 lines (32 loc) · 1.15 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
---
build:
stage: build
script:
- 'mvn clean deploy -U -DskipTests'
- 'docker tag docker.mobike.io/$CI_PROJECT_PATH docker.mobike.io/$CI_PROJECT_PATH/$CI_BUILD_REF_NAME:`git rev-parse --short=8 HEAD`'
- 'docker tag docker.mobike.io/$CI_PROJECT_PATH docker.mobike.io/$CI_PROJECT_PATH/$CI_BUILD_REF_NAME'
- 'docker push docker.mobike.io/$CI_PROJECT_PATH/$CI_BUILD_REF_NAME:`git rev-parse --short=8 HEAD`'
- 'docker image rm docker.mobike.io/$CI_PROJECT_PATH/$CI_BUILD_REF_NAME:`git rev-parse --short=8 HEAD`'
- 'docker image rm docker.mobike.io/$CI_PROJECT_PATH/$CI_BUILD_REF_NAME'
- 'docker image rm docker.mobike.io/$CI_PROJECT_PATH'
only:
- /^feature\/.*$/
- /^hotfix\/.*$/
- /^release\/.*$/
release:
stage: build
script:
- 'rm -f release.properties pom.xml.releaseBackup'
- 'mvn release:prepare -B'
- 'rm -f release.properties pom.xml.releaseBackup'
only:
- /^release\/.*$/
when: manual
deploy:
stage: build
script:
- 'mvn clean deploy -DskipTests'
- 'docker image rm docker.mobike.io/$CI_PROJECT_PATH:$CI_COMMIT_TAG'
- 'docker image rm docker.mobike.io/$CI_PROJECT_PATH'
only:
- tags