-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (46 loc) · 1.17 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
image: gradle:6.1.1-jdk8
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stages:
- build
- test
- deploy
# Main CI Jobs
Build:
stage: build
script:
- gradle assemble
artifacts:
paths:
- build/libs/*.jar
expire_in: 1 week
CheckStyle:
stage: test
script: gradle checkstyleMain
allow_failure: true
TestMain:
stage: test
script:
- gradle check
- gradle test
- gradle jacocoTestReport
- cat build/reports/jacoco/test/html/index.html
Deployment:
only:
- master
image: ruby:2.4
stage: deploy
before_script:
- gem install dpl
- wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
script:
- dpl --provider=heroku --app=$HEROKU_APPNAME --api-key=$HEROKU_APIKEY
- export HEROKU_API_KEY=$HEROKU_APIKEY
- heroku config:set --app $HEROKU_APPNAME LINE_CHANNEL_SECRET=$LINE_CHANNEL_SECRET
- heroku config:set --app $HEROKU_APPNAME LINE_CHANNEL_ACCESS_TOKEN=$LINE_CHANNEL_ACCESS_TOKEN
- heroku run --app $HEROKU_APPNAME migrate
environment:
name: production
url: $HEROKU_APP_HOST