-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
62 lines (54 loc) · 1.24 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
image: docker:latest
services:
- docker:dind
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
GIT_STRATEGY: clone
DOCKER_DRIVER: overlay
stages:
- build
- package
- deploy
before_script:
- echo `pwd`
- echo Starting CI $CI_PROJECT_NAME@$CI_COMMIT_SHORT_SHA...
- export GRADLE_USER_HOME=`pwd`/.gradle
- export PATH=`pwd`/.gradle/nodejs/node-v10.14.1-linux-x64/bin:$PATH
- rm -f .gradle/caches/modules-2/modules-2.lock
- rm -fr .gradle/caches/*/plugin-resolution/
cache:
paths:
- .gradle/wrapper
- .gradle/caches
build-gradle:
image: gradle:slim
stage: build
script:
- ./gradlew --full-stacktrace stage
only:
- master
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build
- .gradle
build-docker:
image: gradle:slim
stage: build
script:
- ./gradlew --full-stacktrace unpackBootJar
only:
- master
artifacts:
paths:
- align-ws/build/
deploy-docker-hub:
stage: deploy
script:
- cd align-ws
- echo $DH_REGISTRY_PASSWORD | docker login $DH_REGISTRY -u $DH_REGISTRY_USER --password-stdin
- docker build -t "$DH_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$DH_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
only:
- master