forked from gooddata/gooddata-server-oauth2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
72 lines (72 loc) · 1.89 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
default:
image: adoptopenjdk/openjdk11:$BUILD_IMAGE_VERSION
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
BUILD_IMAGE_VERSION: "x86_64-debianslim-jdk-11.0.10_9"
AWS_ECR_URL: '441851189095.dkr.ecr.eu-central-1.amazonaws.com'
stages:
- compliance-check
- build
- test
- release
compliance-check:
image: $AWS_ECR_URL/infra/compliance-check:latest
stage: compliance-check
dependencies: []
variables:
GIT_STRATEGY: none
GITLAB_API_PRIVATE_TOKEN: $COMPLIANCE_CHECK_TOKEN
before_script: []
script:
- echo "Running compliance check in enforcing mode..."
- /scripts/gitlab.sh
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
when: always
build-kotlin:
stage: build
cache:
key: kotlin-build
paths:
- .gradle
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- ./gradlew clean build compileTestKotlin -x test --info
artifacts:
paths:
- '**/build/**/*'
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
test-kotlin:
stage: test
cache:
key: kotlin-build
policy: pull
paths:
- .gradle
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- ./gradlew test --info
dependencies:
- build-kotlin
artifacts:
reports:
junit: '**/build/test-results/**/TEST-*.xml'
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
build-and-publish-library:
stage: release
dependencies: []
cache:
key: kotlin-build
paths:
- .gradle
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
# publish to GitLab package registry is done, a corresponding tag needs to be created beforehand
- ./gradlew clean publishLibraryPublicationToGitlabMavenRepository -Prelease_version=${CI_COMMIT_TAG#*gooddata-server-oauth2-} --info
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'