-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
86 lines (76 loc) · 2.13 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
74
75
76
77
78
79
80
81
82
83
84
85
86
default:
tags:
- exec-docker
image: ghcr.io/graalvm/graalvm-community:21
cache: # Cache modules in between jobs
key: $CI_COMMIT_REF_SLUG
paths:
- .gradle
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
when: never
- if: "$CI_COMMIT_BRANCH"
stages:
- build
- code-analysis
- test
- publish
build:
stage: build
script: ./gradlew assemble
artifacts:
paths:
- build
pmd:
stage: code-analysis
script: ./gradlew pmdMain
artifacts:
paths:
- build
checkstyle:
stage: code-analysis
script: ./gradlew checkstyleMain
artifacts:
paths:
- build
unit-test:
stage: test
script:
- ./gradlew test
artifacts:
paths:
- build
.push-dockerhub-base-job:
stage: publish
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
script:
- ./gradlew clean assemble
-Dquarkus.container-image.build=true
-Dquarkus.container-image.push=true
-Dquarkus.container-image.additional-tags=$CI_COMMIT_SHORT_SHA
-Dquarkus.container-image.username=$DOCKERHUB_USERNAME
-Dquarkus.container-image.password=$DOCKERHUB_PASSWORD
after_script:
- echo "Image was uploaded to Dockerhub; explorviz/${DOCKERHUB_IMAGE_NAME}:latest and explorviz/${DOCKERHUB_IMAGE_NAME}:$CI_COMMIT_SHORT_SHA"
push-dockerhub-main:
extends: .push-dockerhub-base-job
push-dockerhub-mr:
stage: publish
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- ./gradlew clean assemble
-Dquarkus.container-image.build=true
-Dquarkus.container-image.push=true
-Dquarkus.container-image.tag=mr-$CI_MERGE_REQUEST_IID
-Dquarkus.container-image.username=$DOCKERHUB_USERNAME
-Dquarkus.container-image.password=$DOCKERHUB_PASSWORD
after_script:
- echo "Image was uploaded to Dockerhub; explorviz/${DOCKERHUB_IMAGE_NAME}:mr-$CI_MERGE_REQUEST_IID"