-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
41 lines (35 loc) · 906 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
37
38
39
40
41
image: maven:3.8.3-openjdk-17
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
MAVEN_CLI_OPTS: "--batch-mode -P headless -DskipUiTests=true"
stages:
- test
- build
- semantic-release
cache:
paths:
- .m2/repository
key: "$CI_BUILD_REF_NAME"
test:
stage: test
rules:
- if: '$CI_COMMIT_BRANCH == "skip test"'
script:
- cd workoutplanner
- mvn clean test $MAVEN_CLI_OPTS
build:
stage: build
rules:
- if: '$CI_COMMIT_BRANCH == "skip build"'
when: manual
script:
- "cd workoutplanner; mvn clean install $MAVEN_CLI_OPTS"
semantic-release:
image: node:latest
stage: semantic-release
rules:
- if: "$CI_COMMIT_MESSAGE !~ /^chore(release)*/"
script:
- export GITLAB_TOKEN=$SEMANTIC_RELEASE_TOKEN
- npm install @semantic-release/git @semantic-release/gitlab @semantic-release/changelog
- npx semantic-release