-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
43 lines (40 loc) · 972 Bytes
/
.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
stages:
- build
- test
- package
- deploy
build:
image: openjdk:11
stage: build
script:
- ./gradlew clean
- ./gradlew build -Pprofile=prod
artifacts:
paths:
- build/libs/*.jar
expire_in: 10 min
test:
image: openjdk:11
stage: test
script:
- ./gradlew test
package:
image: docker:latest
stage: package
services:
- name: docker:dind
alias: dockerdaemon
variables:
# Tell docker CLI how to talk to Docker daemon.
DOCKER_HOST: tcp://dockerdaemon:2375/
# Use the overlayfs driver for improved performance.
DOCKER_DRIVER: overlay2
# Disable TLS since we're running inside local network.
DOCKER_TLS_CERTDIR: ""
before_script:
- docker login -u $DOCKER_HUB_USER --password-stdin < $DOCKER_HUB_PW
script:
- docker build -t $DOCKER_HUB_USER/modak-springboot-app --platform linux/amd64 .
- docker push $DOCKER_HUB_USER/modak-springboot-app
after_script:
- docker logout