2024-07-05 06:35:48 +00:00
|
|
|
stages:
|
2024-07-09 08:40:04 +00:00
|
|
|
- build
|
|
|
|
# - test
|
2024-07-05 06:35:48 +00:00
|
|
|
# - package
|
2024-07-09 08:40:04 +00:00
|
|
|
# - publish
|
|
|
|
# - release
|
|
|
|
|
|
|
|
.kotlin-job: &kotlin
|
|
|
|
image: domaindrivenarchitecture/ddadevops-kotlin:4.10.7
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- .gradle/wrapper
|
|
|
|
- .gradle/caches
|
2024-07-05 06:35:48 +00:00
|
|
|
before_script:
|
2024-07-09 08:40:04 +00:00
|
|
|
- echo "---------- Start CI ----------"
|
|
|
|
- export GRADLE_USER_HOME=`pwd`/.gradle
|
|
|
|
- chmod +x gradlew
|
|
|
|
- export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW
|
|
|
|
- echo "------ commit info ---------------"
|
|
|
|
- echo $CI_COMMIT_TAG
|
|
|
|
- echo $CI_COMMIT_REF_NAME
|
|
|
|
- echo "----------------------------------"
|
2024-07-05 06:35:48 +00:00
|
|
|
|
|
|
|
.tag_only: &tag_only
|
|
|
|
rules:
|
|
|
|
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
|
|
|
|
|
2024-07-09 08:40:04 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
<<: *kotlin
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- graalvm_jdk_version="22.0.1"
|
|
|
|
- curl -SsLo /tmp/graalvm-community-jdk.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${graalvm_jdk_version}/graalvm-community-jdk-${graalvm_jdk_version}_linux-x64_bin.tar.gz
|
|
|
|
- curl -SsLo /tmp/graalvm-checksum https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${graalvm_jdk_version}/graalvm-community-jdk-${graalvm_jdk_version}_linux-x64_bin.tar.gz.sha256
|
|
|
|
- echo " /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz"|tee -a /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz.sha256
|
|
|
|
- sha256sum -c --status /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz.sha256
|
|
|
|
- mkdir /usr/lib/jvm/
|
|
|
|
- tar -C /usr/lib/jvm/ -xzf /tmp/graalvm-jdk-${graalvm_JDK_version}_linux-x64_bin.tar.gz
|
|
|
|
- dirname_graalvm=$(ls /usr/lib/jvm/|grep -e graa)
|
|
|
|
- ln -s /usr/lib/jvm/$dirname_graalvm /usr/lib/jvm/graalvm
|
|
|
|
- export JAVA_HOME=/usr/lib/jvm/graalvm
|
|
|
|
- ./gradlew clean build -Pvaadin.productionMode
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- build/libs/*.jar
|
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
variables:
|
|
|
|
DOCKER_TLS_CERTDIR: "/certs"
|
|
|
|
|
2024-07-05 06:35:48 +00:00
|
|
|
|
2024-07-05 08:14:25 +00:00
|
|
|
test:
|
2024-07-08 10:17:24 +00:00
|
|
|
stage: test
|
2024-07-09 08:40:04 +00:00
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
before_script:
|
|
|
|
- echo "---------- BEFORE -------------"
|
|
|
|
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
|
2024-07-05 06:35:48 +00:00
|
|
|
script:
|
2024-07-09 08:40:04 +00:00
|
|
|
- echo "---------- TEST -------------"
|
|
|
|
- apk -U update && apk add bash
|
|
|
|
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
|
|
|
|
- docker run --privileged -dit --name meapp_test -v /var/run/docker.sock:/var/run/docker.sock $CI_REGISTRY_IMAGE
|
|
|
|
- docker inspect -f '{{.State.Running}}' meapp_test
|
|
|
|
- ./gradlew -x assemble test -Dtestdockerwithoutsudo=true -DexcludeTags=extensivecontainertest,nonci
|
|
|
|
artifacts:
|
|
|
|
when: on_failure
|
|
|
|
paths:
|
|
|
|
- build/reports/*
|
|
|
|
reports:
|
|
|
|
junit: build/test-results/test/TEST-*.xml
|
|
|
|
|
|
|
|
|
|
|
|
package:
|
|
|
|
<<: *kotlin
|
|
|
|
stage: package
|
|
|
|
script:
|
|
|
|
- pyb package
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- build/libs/*.jar
|
|
|
|
- build/libs/*.lst
|
|
|
|
|
|
|
|
|
|
|
|
publish-maven-package-to-gitlab:
|
|
|
|
<<: *kotlin
|
|
|
|
<<: *tag_only
|
|
|
|
stage: publish
|
|
|
|
script:
|
|
|
|
- ./gradlew -x assemble -x test publishLibraryPublicationToGitlabRepository
|
|
|
|
|
|
|
|
|
|
|
|
publish-maven-package-to-meissa:
|
|
|
|
<<: *kotlin
|
|
|
|
<<: *tag_only
|
|
|
|
stage: publish
|
|
|
|
allow_failure: true
|
|
|
|
script:
|
|
|
|
- ./gradlew -x assemble -x test publishLibraryPublicationToMeissaRepository
|
|
|
|
|
|
|
|
|
|
|
|
release-to-meissa:
|
|
|
|
<<: *kotlin
|
|
|
|
<<: *tag_only
|
|
|
|
stage: release
|
|
|
|
allow_failure: true
|
|
|
|
script:
|
|
|
|
- pyb publish_release
|
2024-07-05 06:35:48 +00:00
|
|
|
|
2024-07-08 10:17:24 +00:00
|
|
|
after_script:
|
|
|
|
- echo "---------- End CI ----------"
|