From 991c3b4533ef82f685c319bb3d86daee8514867d Mon Sep 17 00:00:00 2001 From: Alexander Weigl Date: Tue, 13 Feb 2018 22:27:36 +0100 Subject: [PATCH] new ci file --- .gitlab-ci.yml | 90 +++++++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a03a0919..c55f52a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,61 +1,75 @@ -image: key-ant-openjdk-8:latest +# This is the Gradle build system for JVM applications +# https://gradle.org/ +# https://github.com/gradle/gradle +image: key-dev-jdk8 cache: paths: - .m2/ + - .gradle/ + +# Disable the Gradle daemon for Continuous Integration servers as correctness +# is usually a priority over speed in CI environments. Using a fresh +# runtime for each build is more reliable since the runtime is completely +# isolated from any previous builds. +variables: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + +before_script: + - export GRADLE_USER_HOME=`pwd`/.gradle variables: - MAVEN_OPTS: >- - -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2 - -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN - -Dorg.slf4j.simpleLogger.showDateTime=true GIT_SSL_NO_VERIFY: "true" stages: - - setup - build - test - deploy -setup: - stage: setup - script: - - COMPONENTS=keydeps/lib/components/ - - GID=key-project-psdbg - - V=2.7-SNAPSHOT - - mvn install:install-file -Dfile=$COMPONENTS/key.core.jar -DartifactId=key.core -DgroupId=$GID -Dversion=$V -Dpackaging=jar - - mvn install:install-file -Dfile=$COMPONENTS/key.ui.jar -DartifactId=key.ui -DgroupId=$GID -Dversion=$V -Dpackaging=jar - - mvn install:install-file -Dfile=$COMPONENTS/key.util.jar -DartifactId=key.util -DgroupId=$GID -Dversion=$V -Dpackaging=jar - - mvn install:install-file -Dfile=$COMPONENTS/../libs/recoderKey.jar -DartifactId=recoder -DgroupId=$GID -Dversion=2.7 -Dpackaging=jar - -build: +build:jdk9: stage: build - script: "mvn compile -B -T 2" + image: key-dev-jdk9 + script: gradle --build-cache assemble + allow_failure: true + cache: + key: "$CI_COMMIT_REF_NAME" + policy: push + paths: + - build + - .gradle + + +build:jdk8: + stage: build + script: gradle --build-cache assemble + image: key-dev-jdk8 + cache: + key: "$CI_COMMIT_REF_NAME" + policy: push + paths: + - build + - .gradle test: stage: test - script: "mvn test -B" + script: gradle check + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull + paths: + - build + - .gradle deploy: stage: deploy - script: - - "mvn package -DperformRelease=true -DcreateChecksum=true -DskipTests=true -B" - artifacts: + script: gradle distJar + cache: + key: "$CI_COMMIT_REF_NAME" + policy: pull paths: - - "*/target/*.jar" - allow_failure: true - -sonar: - stage: deploy - script: - - "mvn org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.organization=wadoon-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=3441b7b4ade9f61b61b75322893d084c51d8acc3" - allow_failure: true - -site: - stage: deploy - script: - - "mvn site:site -DskipTests=true -B" + - build + - .gradle artifacts: paths: - - "*/target/site/*" - allow_failure: true \ No newline at end of file + - "build/libs/*.jar" + allow_failure: true -- GitLab