-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
95 lines (85 loc) · 2.02 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
87
88
89
90
91
92
93
94
95
variables:
ANDROID_IMAGE: $ANDROID_DOCKER_IMAGE_URL_JDK_17
DEFAULT_BRANCH: "main"
stages:
- automation
- build
- test
- release
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/*
test:
stage: test
image: $ANDROID_IMAGE
script:
- ./gradlew testDebugUnitTest
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- if: $CI_COMMIT_BRANCH == $DEFAULT_BRANCH
when: always
- when: never
tags:
- docker
build:
stage: build
image: $ANDROID_IMAGE
script:
- ./gradlew assemble
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- if: $CI_COMMIT_BRANCH == $DEFAULT_BRANCH
when: always
- when: never
tags:
- docker
.automation:
stage: automation
image: $ANDROID_IMAGE
before_script:
- echo "$TOOLS_PROPERTIES" > tools.properties
- echo "$TOOLS_SLACK_PROPERTIES" > slack.properties
- echo "$TOOLS_CONFLUENCE_PROPERTIES" > confluence.properties
- wget -O tools.jar $TOOLS_JAR_URL
tags:
- docker
assign MR:
extends: .automation
script:
- java -jar tools.jar assignMR -mr="$CI_MERGE_REQUEST_IID"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual
- when: never
allow_failure: true
check approvals:
extends: .automation
script:
- java -jar tools.jar checkApprovals
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "checkApprovals"'
release minor:
extends: .automation
script:
- java -jar tools.jar makeReleaseBranch
- java -jar tools.jar buildRelease
- java -jar tools.jar postReleaseMerges
rules:
- if: $CI_COMMIT_BRANCH == $DEFAULT_BRANCH
when: manual
- when: never
release patch:
extends: .automation
script:
- java -jar tools.jar makeHotfixBranch
- java -jar tools.jar buildRelease
- java -jar tools.jar postReleaseMerges
rules:
- if: $CI_COMMIT_BRANCH == $DEFAULT_BRANCH
when: manual
- when: never