From 5feb9dffb0d2dccb4d2a6987da756909cd6c0cf5 Mon Sep 17 00:00:00 2001 From: Marcel Feix Date: Fri, 8 Jul 2022 10:19:41 +0200 Subject: [PATCH] chore(*): Rebase on Master --- .../chapters/templates/tool-sonar8.adoc | 28 --------------- .../container/container-build.gitlab-ci.yml | 12 +++++-- tool-sonar8.gitlab-ci.yml | 35 ------------------- 3 files changed, 10 insertions(+), 65 deletions(-) delete mode 100644 documentation/chapters/templates/tool-sonar8.adoc delete mode 100644 tool-sonar8.gitlab-ci.yml diff --git a/documentation/chapters/templates/tool-sonar8.adoc b/documentation/chapters/templates/tool-sonar8.adoc deleted file mode 100644 index 1e32ca6..0000000 --- a/documentation/chapters/templates/tool-sonar8.adoc +++ /dev/null @@ -1,28 +0,0 @@ -:sourcedir: ../../../ - -= Sonar 8 template - -Ruft den Sonar Job für das Projekt auf. -Mehr Details zu finden hier: https://gitlab.exxcellent.de/gilden/ci/exxcellent-sonar-tool[Gilde CI/CD: exxcellent-sonar-tool]. - -.Variables -|=== -|Name |Description | Default Value -|SONAR_HOST_URL | Die URL des eXXcellent sonar servers | https://sonar.exxcellent.de/sonar8 -|SONAR_PROJECT_KEY | Der Sonar-Projekt-Key. | "" -|SONAR_PROJECT_NAME | Der Sonar-Projekt-Name. | "" (Es wird dann standardmäßig der Maven project.name verwendet) -|SONAR_EXCLUSIONS | Von Sonar auszuschließende Bereiche | **/target/**,**/src/test/** -|GRADLE_CLI_OPTS | Zusätzliche CLI Opts für Gradle | "" -|SONAR_QUALITYGATE_WAIT | Definiert, ob auf das Quality-Gate gewartet werden soll. Muss auf True gesetzt werden damit das Quality gate beachtet wird. Wenn das Quality-Gate beachtet werden aber die Pipeline nicht Fehlschlagen soll empfehlen das Flag `allow_failure` auf `true` zu setzen. | true -|SONAR_QUALITYGATE_TIMEOUT | Zeit bis zum Timeout der Quality gate abfrage | 10000 - -|=== - -TIP: Der SONAR_TOKEN String kann über den persönlichen User Bereich in Sonar unter dem Tab _Security_ erzeugt werden. -Ein technischer User ist aktuell nicht möglich. - -.sonar-template -[source,yaml] ----- -include::{sourcedir}/tool-sonar8.gitlab-ci.yml[] ----- diff --git a/templates/container/container-build.gitlab-ci.yml b/templates/container/container-build.gitlab-ci.yml index 446257d..faa3c10 100644 --- a/templates/container/container-build.gitlab-ci.yml +++ b/templates/container/container-build.gitlab-ci.yml @@ -36,8 +36,16 @@ entrypoint: [ "" ] variables: DOCKERFILE_LOCATION: $CI_PROJECT_DIR/Dockerfile - REGISTRY_MIRROR: --registry-mirror nexus.corp.exxcellent.de:18000 --skip-tls-verify-registry nexus.corp.exxcellent.de:18000 --skip-tls-verify + REGISTRY_MIRROR: --registry-mirror nexus.corp.exxcellent.de:18000 --skip-tls-verify-registry nexus.corp.exxcellent.de:18000 script: - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$DOCKER_REGISTRY_USER\",\"password\":\"$DOCKER_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --context $CONTEXT_LOCATION --dockerfile $DOCKERFILE_LOCATION --no-push --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA $EXTRA_ARGS $REGISTRY_MIRROR --tarPath image.tar + - >- + /kaniko/executor + --context $CONTEXT_LOCATION + --dockerfile $DOCKERFILE_LOCATION + --no-push + --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA + $EXTRA_ARGS + $REGISTRY_MIRROR + --tarPath image.tar diff --git a/tool-sonar8.gitlab-ci.yml b/tool-sonar8.gitlab-ci.yml deleted file mode 100644 index 2b0210d..0000000 --- a/tool-sonar8.gitlab-ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -.sonar-template-common: - stage: test - variables: - SONAR_HOST_URL: https://sonar.exxcellent.de/sonar8 - SONAR_PROJECT_KEY: "" - SONAR_PROJECT_NAME: "" - SONAR_EXCLUSIONS: "**/target/**,**/src/test/**" - SONAR_QUALITYGATE_WAIT: "true" - SONAR_QUALITYGATE_TIMEOUT: "10000" - -.sonar-template: - extends: .sonar-template-common - image: $MAVEN_IMAGE - script: - - mvn $MAVEN_CLI_OPTS test sonar:sonar - "-Dsonar.host.url=$SONAR_HOST_URL" - "-Dsonar.login=$SONAR_TOKEN" - "-Dsonar.projectKey=$SONAR_PROJECT_KEY" - "-Dsonar.projectName=$SONAR_PROJECT_NAME" - "-Dsonar.exclusions=$SONAR_EXCLUSIONS" - "-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT" - "-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT" - -.sonar-template-gradle: - extends: .sonar-template-common - image: $GRADLE_IMAGE - script: - - ./gradlew $GRADLE_OPTS $GRADLE_CLI_OPTS sonarqube - "-Dsonar.host.url=$SONAR_HOST_URL" - "-Dsonar.login=$SONAR_TOKEN" - "-Dsonar.projectKey=$SONAR_PROJECT_KEY" - "-Dsonar.projectName=$SONAR_PROJECT_NAME" - "-Dsonar.exclusions=$SONAR_EXCLUSIONS" - "-Dsonar.qualitygate.wait=$SONAR_QUALITYGATE_WAIT" - "-Dsonar.qualitygate.timeout=$SONAR_QUALITYGATE_TIMEOUT"