Unanswered
for native image build
stages:
- build
- notify
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --no-transfer-progress --show-version -DdeployAtEnd=true"
QUARKUS_JIB_BASE_REGISTRY_USERNAME: $DOCKER_USER
QUARKUS_JIB_BASE_REGISTRY_PASSWORD: $DOCKER_PASSWORD
QUARKUS_CONTAINER_IMAGE_USERNAME: $DOCKER_USER
QUARKUS_CONTAINER_IMAGE_PASSWORD: $DOCKER_PASSWORD
cache:
paths:
- .m2/repository/
build:snapshot:
image: dockr.swgt.at/quarkus/ubi-quarkus-native-image:21.3.2-java17
stage: build
variables:
VERSION: $CI_COMMIT_SHORT_SHA
only:
- main
tags:
- ...
script:
#- ./mvnw versions:set -DnewVersion=$VERSION
- ./mvnw $MAVEN_CLI_OPTS -Dbuild.revision=$VERSION prepare-package -DskipTests=true
- ./mvnw $MAVEN_CLI_OPTS -Dbuild.revision=$VERSION at.campusonline.conx.maven:conx-maven-plugin:package package -DskipTests=true -P native
artifacts:
paths:
- target/*.zip
build:production:
image: dockr.swgt.at/quarkus/ubi-quarkus-native-image:21.3.2-java17
stage: build
variables:
VERSION: $CI_COMMIT_REF_NAME
COMMIT_ID: $CI_COMMIT_SHORT_SHA
only:
- /^(\d+\.)(\d+\.)(\d+)(-[a-z]+)?$/
except:
- branches
tags:
- ...
script:
- ./mvnw versions:set -DnewVersion=$VERSION
- ./mvnw $MAVEN_CLI_OPTS -Dbuild.revision=$COMMIT_ID prepare-package -DskipTests=true
- ./mvnw $MAVEN_CLI_OPTS -Dbuild.revision=$COMMIT_ID at.campusonline.conx.maven:conx-maven-plugin:package package -DskipTests=true -P native
artifacts:
paths:
- target/*.zip
when: manual
271 Views
0
Answers
2 years ago
2 years ago
Watch out this is only example code. Change it to your needs and there is no deployment or integration testing.