-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (43 loc) · 1017 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
42
43
44
45
46
47
48
49
50
51
52
image: java:8-jdk
stages:
- build
- test
- deploy
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./gradlew
cache:
paths:
- .gradle/wrapper
- .gradle/caches
build:
stage: build
script:
- ./gradlew compileTestJava
test:
stage: test
script:
- ./gradlew build
- ./gradlew jacocoTestReport
- cat build/reports/jacoco/test/html/index.html
artifacts:
reports:
junit: build/test-results/test/TEST-*.xml
paths:
- build/libs/*.jar
- build/reports/jacoco/test/html/
expire_in: 1 day
deploy_production:
stage: deploy
environment: Production
image: dxjoke/googlecloud-sdk-java-docker:jdk8
only:
- develop
- master
script:
- echo $DEPLOY_KEY_FILE_PRODUCTION > /tmp/$CI_PIPELINE_ID.json
- gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
- gcloud config set project $PROJECT_ID_PRODUCTION
- ./gradlew appengineDeploy
after_script:
- rm /tmp/$CI_PIPELINE_ID.json