From 56c389b4373e10edda7f5dbc38b0d6abad3aa9ca Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Sun, 12 Dec 2021 12:33:31 +0100 Subject: add GitLab CI configuration --- .gitlab-ci.yml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .gitlab-ci.yml (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..310e2051 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,84 @@ +image: gradle:6.8.3-jdk11 + +variables: + LC_ALL: "en_US.UTF-8" + LANG: "en_US.UTF-8" + LANGUAGE: "en_US" + LIB_NAME: "PDF-AS 4" + GIT_DEPTH: "2" + SECURE_LOG_LEVEL: "debug" + +include: + - template: Dependency-Scanning.gitlab-ci.yml + - template: Security/SAST.gitlab-ci.yml + - template: Secret-Detection.gitlab-ci.yml + +default: + tags: + - docker + +stages: + - assemble + - test + - package + - release + +cache: + paths: + - .m2/repository + - .gradle/wrapper + - .gradle/caches + +assemble: + stage: assemble + tags: + - docker + except: + - tags + script: | + ./gradlew clean build --warning-mode all + artifacts: + when: always + reports: + junit: "**/build/test-results/test/**/TEST-*.xml" + +release_packaging: + stage: package + tags: + - docker + except: + - tags + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: | + ./gradlew assemble uploadArchives + artifacts: + when: always + name: "${CI_PROJECT_NAME}-${CI_COMMIT_SHORT_SHA}" + reports: + dotenv: variables.env + +release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + tags: + - docker + needs: + - job: assemble + artifacts: true + when: manual + only: + - master + script: | + echo "Releasing version $VERSION of $LIB_NAME" + echo "Publishing version $VERSION to public EGIZ maven" + cd ./moaSig + ./gradlew release + artifacts: + name: "${CI_PROJECT_NAME}-${CI_COMMIT_SHORT_SHA}-release" + expire_in: never + paths: + - "../release/${VERSION}/pdf-as-web-${VERSION}.war" + - "../release/${VERSION}/pdf-as-lib-${VERSION}.zip" -- cgit v1.2.3