From 3c45b8cceae29a07cb9d40fb1201f8d214c61841 Mon Sep 17 00:00:00 2001 From: greedy-coder <2502564597@qq.com> Date: Sun, 15 Jan 2023 14:37:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改成本地环境变量信息 --- Jenkinsfile-online | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile-online b/Jenkinsfile-online index 2ca69e7f..6a2b7a89 100644 --- a/Jenkinsfile-online +++ b/Jenkinsfile-online @@ -14,8 +14,8 @@ pipeline { GITHUB_CREDENTIAL_ID = 'github-id' KUBECONFIG_CREDENTIAL_ID = 'demo-kubeconfig' REGISTRY = 'docker.io' - DOCKERHUB_NAMESPACE = 'docker_username' - GITHUB_ACCOUNT = 'kubesphere' + DOCKERHUB_NAMESPACE = 'jasmine918' + GITHUB_ACCOUNT = 'bug-correcter' APP_NAME = 'devops-java-sample' } From 69c5e6ea39bb65d153b2feff2a50e0b269706190 Mon Sep 17 00:00:00 2001 From: greedy-coder <2502564597@qq.com> Date: Sun, 15 Jan 2023 15:43:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9jdk=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 弃用java:openjdk-8-jre-alpine --- Dockerfile-online | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-online b/Dockerfile-online index 9e99459f..a6c44d2e 100644 --- a/Dockerfile-online +++ b/Dockerfile-online @@ -1,4 +1,4 @@ -FROM java:openjdk-8-jre-alpine +FROM openjdk:8 WORKDIR /home From 9d922b00a304cf994b7280a482eaa8a081b8c2f0 Mon Sep 17 00:00:00 2001 From: greedy-coder <2502564597@qq.com> Date: Sun, 15 Jan 2023 19:07:24 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sonarqube=20analysis?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码质量检查 --- Jenkinsfile-online | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Jenkinsfile-online b/Jenkinsfile-online index 6a2b7a89..1e01fff6 100644 --- a/Jenkinsfile-online +++ b/Jenkinsfile-online @@ -17,6 +17,7 @@ pipeline { DOCKERHUB_NAMESPACE = 'jasmine918' GITHUB_ACCOUNT = 'bug-correcter' APP_NAME = 'devops-java-sample' + SONAR_CREDENTIAL_ID= 'sonar-token' } stages { @@ -33,6 +34,21 @@ pipeline { } } } + + stage('sonarqube analysis') { + steps { + container ('maven') { + withCredentials([string(credentialsId: "$SONAR_CREDENTIAL_ID", variable: 'SONAR_TOKEN')]) { + withSonarQubeEnv('sonar') { + sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.login=$SONAR_TOKEN" + } + } + timeout(time: 1, unit: 'HOURS') { + waitForQualityGate abortPipeline: true + } + } + } + } stage ('build & push') { steps { From 2aebd2d3116171735eea53df3fe0139cda6dfccf Mon Sep 17 00:00:00 2001 From: greedy-coder <2502564597@qq.com> Date: Sun, 15 Jan 2023 19:49:42 +0800 Subject: [PATCH 4/4] rollback --- Jenkinsfile-online | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Jenkinsfile-online b/Jenkinsfile-online index 1e01fff6..6a2b7a89 100644 --- a/Jenkinsfile-online +++ b/Jenkinsfile-online @@ -17,7 +17,6 @@ pipeline { DOCKERHUB_NAMESPACE = 'jasmine918' GITHUB_ACCOUNT = 'bug-correcter' APP_NAME = 'devops-java-sample' - SONAR_CREDENTIAL_ID= 'sonar-token' } stages { @@ -34,21 +33,6 @@ pipeline { } } } - - stage('sonarqube analysis') { - steps { - container ('maven') { - withCredentials([string(credentialsId: "$SONAR_CREDENTIAL_ID", variable: 'SONAR_TOKEN')]) { - withSonarQubeEnv('sonar') { - sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.login=$SONAR_TOKEN" - } - } - timeout(time: 1, unit: 'HOURS') { - waitForQualityGate abortPipeline: true - } - } - } - } stage ('build & push') { steps {