-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy path.gitlab-ci.yml
39 lines (35 loc) · 1.05 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
image: java:8
stages:
- build
- release
- publish
maven-build-snapshot:
image: gitlab.cambiocds.com:4567/tools/docker-builder
stage: build
script:
- mvn clean package sonar:sonar -P sonar
except:
- /^release-.*$/
- tags
maven-build-tag:
image: gitlab.cambiocds.com:4567/tools/docker-builder
stage: build
script:
- mvn clean deploy sonar:sonar -P sonar
only:
- tags
release:
image: gitlab.cambiocds.com:4567/tools/docker-builder
stage: release
when: manual
script:
- git remote set-url origin $(echo $CI_REPOSITORY_URL | sed -e 's/[^@]\+@\([^\/]\+\)\//git@\1\:/')
- git checkout -b release-$CURRENT_VERSION
- git push -u origin release-$CURRENT_VERSION
- mvn versions:set -DnewVersion=$CURRENT_VERSION
- git commit -a -m "Changing to version "$CURRENT_VERSION
- git tag $CURRENT_VERSION
- git push origin $CURRENT_VERSION --tags
- git push origin --delete release-$CURRENT_VERSION
only:
- master