Skip to content
Snippets Groups Projects

Build native images in CI pipeline

Merged Sören Henning requested to merge build-native-images into theodolite-kotlin
+ 20
10
@@ -176,7 +176,7 @@ deploy-uc4-load-generator:
@@ -176,7 +176,7 @@ deploy-uc4-load-generator:
# Theodolite Framework
# Theodolite Framework
.theodolite:
.theodolite:
image: openjdk:11-jdk
image: ghcr.io/graalvm/graalvm-ce:java11-21.0.0.2
tags:
tags:
- exec-docker
- exec-docker
variables:
variables:
@@ -189,23 +189,33 @@ deploy-uc4-load-generator:
@@ -189,23 +189,33 @@ deploy-uc4-load-generator:
- cd theodolite-quarkus
- cd theodolite-quarkus
- export GRADLE_USER_HOME=`pwd`/.gradle
- export GRADLE_USER_HOME=`pwd`/.gradle
build-theodolite:
build-theodolite-jvm:
stage: build
stage: build
extends: .theodolite
extends: .theodolite
# script: ./gradlew --build-cache assemble -Dquarkus.package.type=native
script: ./gradlew --build-cache assemble
script: ./gradlew --build-cache assemble
artifacts:
artifacts:
paths:
paths:
- "theodolite-quarkus/build/lib/*"
- "theodolite-quarkus/build/lib/*"
- "theodolite-quarkus/build/*-runner.jar"
- "theodolite-quarkus/build/*-runner.jar"
# - "theodolite-quarkus/build/*-runner" # For native image
expire_in: 1 day
 
 
build-theodolite-native:
 
stage: build
 
extends: .theodolite
 
script:
 
- gu install native-image # TODO move to image
 
- ./gradlew --build-cache assemble -Dquarkus.package.type=native
 
artifacts:
 
paths:
 
- "theodolite-quarkus/build/*-runner"
expire_in: 1 day
expire_in: 1 day
test-theodolite:
test-theodolite:
stage: test
stage: test
extends: .theodolite
extends: .theodolite
needs:
needs:
- build-theodolite
- build-theodolite-jvm
 
- build-theodolite-native
script: ./gradlew test --stacktrace
script: ./gradlew test --stacktrace
# Disabled for now
# Disabled for now
@@ -213,7 +223,7 @@ test-theodolite:
@@ -213,7 +223,7 @@ test-theodolite:
stage: check
stage: check
extends: .theodolite
extends: .theodolite
needs:
needs:
- build-theodolite
- build-theodolite-jvm
- test-theodolite
- test-theodolite
script: ./gradlew ktlintCheck --continue
script: ./gradlew ktlintCheck --continue
@@ -222,7 +232,7 @@ test-theodolite:
@@ -222,7 +232,7 @@ test-theodolite:
stage: check
stage: check
extends: .theodolite
extends: .theodolite
needs:
needs:
- build-theodolite
- build-theodolite-jvm
- test-theodolite
- test-theodolite
script: ./gradlew detekt --continue
script: ./gradlew detekt --continue
@@ -232,12 +242,12 @@ deploy-theodolite:
@@ -232,12 +242,12 @@ deploy-theodolite:
- .theodolite
- .theodolite
- .dind
- .dind
needs:
needs:
- build-theodolite
- build-theodolite-native
- test-theodolite
- test-theodolite
script:
script:
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
#- docker build -f src/main/docker/Dockerfile.native -t theodolite .
- docker build -f src/main/docker/Dockerfile.native -t theodolite .
- docker build -f src/main/docker/Dockerfile.jvm -t theodolite .
#- docker build -f src/main/docker/Dockerfile.jvm -t theodolite .
- "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:${DOCKER_TAG_NAME}latest"
- "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:${DOCKER_TAG_NAME}latest"
- "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA"
- "[ ! $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA"
- "[ $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$CI_COMMIT_TAG"
- "[ $CI_COMMIT_TAG ] && docker tag theodolite $CR_HOST/$CR_ORG/theodolite:$CI_COMMIT_TAG"
Loading