-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
37 lines (34 loc) · 872 Bytes
/
.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
stages:
- build
- publish
build:
stage: build
image: maven:3.8.8-eclipse-temurin-17
script:
- cat $MAVEN_SETTINGS
- mvn test -s $MAVEN_SETTINGS
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- .m2/repository
# rules:
# - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
# - when: never
publish:
stage: publish
image: maven:3.8.8-eclipse-temurin-17
script:
- cat $MAVEN_SETTINGS
- mvn deploy -s $MAVEN_SETTINGS
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- .m2/repository
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: manual
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+\-release/' # A specific tag with 'vX.Y.Z-release' pattern is created
# - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
# when: manual
- when: never