forked from OpenFuturePlatform/open-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
73 lines (64 loc) · 1.29 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
image: docker:latest
services:
- docker:dind
stages:
- test
- build
- package
- deploy
variables:
DOCKER_DRIVER: overlay2
###########################
# Building
###########################
unit-tests:
stage: test
image: openjdk:8-jdk
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- ./gradlew check
after_script:
- cat build/reports/jacoco/test/html/index.html
coverage: '/Total.*?([0-9]{1,3})%/'
cache:
paths:
- .gradle/wrapper
- .gradle/caches
artifacts:
when: always
paths:
- build/reports/
expire_in: 1 week
build-jar:
stage: build
image: openjdk:8-jdk
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
script:
- ./gradlew assemble
cache:
paths:
- .gradle/wrapper
- .gradle/caches
artifacts:
paths:
- build/libs/*.jar
expire_in: 1 week
only:
- master
- sprint
###########################
# Packaging
###########################
package-docker:
stage: package
variables:
IMAGE_NAME: docker.zensoft.io/$CI_PROJECT_PATH
IMAGE_VERSION: latest
script:
- docker build -t $IMAGE_NAME:$IMAGE_VERSION .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.zensoft.io
- docker push $IMAGE_NAME:$IMAGE_VERSION
only:
- master