This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
95 lines (85 loc) · 2.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
image: jhipster/jhipster:v5.8.2
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- .gradle/
stages:
- build
- test
- analyze
- package
- release
- deploy
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- ./gradlew npm_install -PnodeInstall --no-daemon
gradle-compile:
stage: build
script:
- ./gradlew compileJava -x check -PnodeInstall --no-daemon
artifacts:
paths:
- build/classes/
- build/generated/
expire_in: 1 day
gradle-test:
stage: test
script:
- ./gradlew test -i -PnodeInstall --no-daemon
artifacts:
when: always
reports:
junit:
- build/test-results/test/TEST-*.xml
- build/reports/tests/test/index.html
paths:
- build/test-results/
- build/jacoco/
- build/reports
expire_in: 1 day
frontend-test:
stage: test
script:
- ./gradlew npm_run_test -PnodeInstall --no-daemon
artifacts:
reports:
junit: build/test-results/TESTS-*.xml
paths:
- build/test-results/
- build/jacoco/
expire_in: 1 day
gradle-package:
stage: package
script:
- ./gradlew bootWar -Pprod -x check --no-daemon
artifacts:
paths:
- build/libs/*.war
expire_in: 1 day
# Uncomment the following line to use gitlabs container registry. You need to adapt the REGISTRY_URL in case you are not using gitlab.com
#docker-push:
# image: docker:latest
# services:
# - docker:dind
# variables:
# REGISTRY_URL: registry.gitlab.com
# DOCKER_HOST: tcp://docker:2375
# DOCKER_DRIVER: overlay2
# IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
# stage: release
# dependencies:
# - gradle-package
# before_script:
# - docker info
# - cp build/libs/*.war src/main/docker
# script:
# - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $REGISTRY_URL
# - docker build -f src/main/docker/Dockerfile -t $IMAGE_TAG src/main/docker
# - docker push $IMAGE_TAG
deploy-to-production:
stage: deploy
script:
- ./gradlew deployHeroku --no-daemon
environment:
name: production
when: manual