-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (56 loc) · 2.19 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
stages:
- build
variables:
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
QUARKUS_CONTAINER_IMAGE_BUILD: "false"
QUARKUS_CONTAINER_IMAGE_PUSH: "false"
QUARKUS_CONTAINER_IMAGE_REGISTRY: "docker.campusonline.community"
QUARKUS_CONTAINER_IMAGE_GROUP: "studo"
QUARKUS_CONTAINER_IMAGE_NAME: "studo-services"
QUARKUS_CONTAINER_IMAGE_TAG: "${CI_COMMIT_SHORT_SHA}"
QUARKUS_CONTAINER_IMAGE_USERNAME: "${DOCKER_USER}"
QUARKUS_CONTAINER_IMAGE_PASSWORD: "${DOCKER_PASSWORD}"
cache:
# key: ${CI_COMMIT_REF_SLUG}
paths:
- /var/maven/.m2
build-docker:
image: maven:3.8.4-openjdk-17-slim
stage: build
only:
- /^(\d+\.)(\d+\.)(\d+)(-[a-z]+)?$/
tags:
- co-cloud
variables:
QUARKUS_CONTAINER_IMAGE_BUILD: "true"
QUARKUS_CONTAINER_IMAGE_PUSH: "true"
VERSION: $CI_COMMIT_REF_NAME
COMMIT_ID: $CI_COMMIT_SHORT_SHA
script:
- mvn $MAVEN_CLI_OPTS versions:set -DnewVersion=$VERSION
- mvn $MAVEN_CLI_OPTS clean -Dbuild.revision=$COMMIT_ID -Dmaven.deploy.skip=true deploy
- mvn $MAVEN_CLI_OPTS -Dbuild.revision=$COMMIT_ID at.campusonline.conx.maven:conx-maven-plugin:0.1.0:package -Dmaven.deploy.skip=true package
artifacts:
paths:
- target/*.zip
build-snapshot-docker:
image: maven:3.8.4-openjdk-17-slim
stage: build
only:
- main
tags:
- co-cloud
variables:
QUARKUS_CONTAINER_IMAGE_BUILD: "true"
QUARKUS_CONTAINER_IMAGE_PUSH: "true"
VERSION: "1.0.0-SNAPSHOT"
COMMIT_ID: $CI_COMMIT_SHORT_SHA
script:
- mvn $MAVEN_CLI_OPTS versions:set -DnewVersion=$VERSION
- mvn $MAVEN_CLI_OPTS clean -Dbuild.revision=$COMMIT_ID -Dmaven.deploy.skip=true deploy
- mvn $MAVEN_CLI_OPTS -Dbuild.revision=$COMMIT_ID at.campusonline.conx.maven:conx-maven-plugin:0.1.0:package -Dmaven.deploy.skip=true package
artifacts:
paths:
- target/*.zip
when: manual