forked from evbox/station-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
73 lines (66 loc) · 1.36 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
variables:
SONAR_TOKEN: $SONAR_TOKEN
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"
default:
image:
name: adoptopenjdk/openjdk11:jdk-11.0.11_9-alpine-slim
build:
stage: build
script:
- ./gradlew build
- mkdir -p ./junit/ && find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ./junit/ \;
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
when: on_success
paths:
- ./.gradle
- ./*/build
artifacts:
when: always
paths:
- reports
reports:
junit: ./junit/TEST-*.xml
sonar:
stage: test
needs: [build]
script:
- ./gradlew sonarqube -Dsonar.login=$SONAR_TOKEN -Dsonar.branch.name=$CI_COMMIT_BRANCH
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
when: always
paths:
- ./*/build
- .gradle
publish-simulator-core:
stage: deploy
needs: [sonar]
when: manual
script:
- ./gradlew simulator-core:publish
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
when: always
paths:
- ./*/build
- .gradle
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
publish-ocpp-model-201:
stage: deploy
needs: [sonar]
when: manual
script:
- ./gradlew payload:ocpp201:publish
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
when: always
paths:
- ./*/build
- .gradle
rules:
- if: '$CI_COMMIT_BRANCH == "master"'