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 ## skip jUnit tests in Test jobs to speed-up build time dependency_scanning: variables: MAVEN_CLI_OPTS: "-DskipTests --settings ${CI_PROJECT_DIR}/.cisettings.xml" DS_JAVA_VERSION: 11 spotbugs-sast: variables: MAVEN_CLI_OPTS: "-DskipTests --settings ${CI_PROJECT_DIR}/.cisettings.xml" SAST_JAVA_VERSION: 11 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 --warning-mode all clean build artifacts: when: always reports: junit: "**/build/test-results/test/**/TEST-*.xml" paths: - "**/pdf-as-tests/src/test/test-suites" release_packaging: stage: package tags: - docker except: - tags - /^feature/.*$/i - /^issue.*$/i before_script: - mkdir -p ~/.ssh - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts script: | ./gradlew --stacktrace -x test 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"