-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
101 lines (93 loc) · 2.15 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
96
97
98
99
100
101
stages:
- build
#- test
- build_frontend
- production_deploy
- develop_deploy
variables:
GRADLE_OPTS: '-Dorg.gradle.daemon=true'
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
build:
script:
- ./gradlew assemble
artifacts:
paths:
- build/libs/*.jar
expire_in: 2h
image: gradle:jdk11
stage: build
cache:
key: '$CI_COMMIT_REF_NAME'
policy: push
paths:
- build
- .gradle
only:
- master
- develop
# - merge_requests
#test:
# image: gradle:alpine
# stage: test
# script:
# - gradle check
# cache:
# key: "$CI_COMMIT_REF_NAME"
# policy: pull
# only:
# #- develop
# - master
build_frontend:
stage: build_frontend
image: node:15.0.0
cache:
key: '$CI_COMMIT_REF_NAME'
policy: push
paths:
- src/main/webapp
script:
#- mkdir src/main/webapp
#- mkdir src/main/webapp/WEB-INF/
#- mkdir src/main/webapp/WEB-INF/view/
- cd frontend
- npm install
- npm run build
- rm -r node_modules
- cd build
- mv -v index.html ../../src/main/webapp/WEB-INF/view/
- mv -v * ../../src/main/webapp/
artifacts:
untracked: true
only:
- master
- develop
#- merge_requests
production_deploy:
stage: production_deploy
image: ruby:latest
artifacts:
when: always
dependencies:
- build_frontend
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- dpl --provider=heroku --app=$HEROKU_APP_MASTER --api-key=$HEROKU_API_KEY --skip_cleanup
only:
- master
develop_deploy:
stage: develop_deploy
image: ruby:latest
artifacts:
when: always
dependencies:
- build_frontend
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- dpl --provider=heroku --app=$HEROKU_APP_DEVELOP --api-key=$HEROKU_API_KEY --skip_cleanup
only:
- develop