-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
62 lines (57 loc) · 1.25 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
variables:
DOCKER_TLS_CERTDIR: "/certs"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
JAVA_OPTS: "-Duser.timezone=UTC"
cache:
key: $CI_JOB_NAME
paths:
- .m2/repository/
stages:
- build
- docker
- deploy
build-gradle:
stage: build
image: gradle:8.10.0-jdk22
cache:
key:
files:
- gradle/wrapper/gradle-wrapper.properties
paths:
- cache/caches/
- cache/notifications/
- cache/wrapper/
script:
- chmod +x ./gradlew
- ./gradlew --build-cache --gradle-user-home cache/ check -x test
- gradle build -x test
artifacts:
name: "pumps-server"
expire_in: 15 min
paths:
- build/libs/*-SNAPSHOT.jar
docker-package:
stage: docker
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
image: docker:stable-dind
services:
- name: docker:stable-dind
alias: docker
needs:
- job: build-gradle
artifacts: true
variables:
DOCKER_BUILDKIT: 1
script:
- ls -halt
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --tag "${CI_REGISTRY_IMAGE}" .
- docker push $CI_REGISTRY_IMAGE
deploy:
stage: deploy
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
trigger:
project: 'leipzig-pumps/deploy'
branch: main