From b9b55cda33e59869223c109cf4151d5bc79f3b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=B6=E9=A3=8E?= <15281205719@163.com> Date: Sat, 19 Jun 2021 17:55:19 +0800 Subject: [PATCH 1/2] Update Jenkinsfile-online --- Jenkinsfile-online | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile-online b/Jenkinsfile-online index dec0cebf..4d89db82 100644 --- a/Jenkinsfile-online +++ b/Jenkinsfile-online @@ -14,10 +14,10 @@ pipeline { GITHUB_CREDENTIAL_ID = 'github-id' KUBECONFIG_CREDENTIAL_ID = 'demo-kubeconfig' REGISTRY = 'docker.io' - DOCKERHUB_NAMESPACE = 'docker_username' - GITHUB_ACCOUNT = 'kubesphere' + DOCKERHUB_NAMESPACE = 'luochunyun' + GITHUB_ACCOUNT = 'LCY2013' APP_NAME = 'devops-java-sample' - SONAR_CREDENTIAL_ID = 'sonar-token' + //SONAR_CREDENTIAL_ID = 'sonar-token' } stages { @@ -35,20 +35,20 @@ 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('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 8789b5f9365f854c92c9f6587be0d8ae61fee8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=B6=E9=A3=8E?= <15281205719@163.com> Date: Sat, 19 Jun 2021 20:55:59 +0800 Subject: [PATCH 2/2] Update Jenkinsfile-online --- Jenkinsfile-online | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Jenkinsfile-online b/Jenkinsfile-online index 4d89db82..4afb3792 100644 --- a/Jenkinsfile-online +++ b/Jenkinsfile-online @@ -26,6 +26,19 @@ pipeline { checkout(scm) } } + + stage ('install podman') { + steps { + container ('maven') { + sh ''' + curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo + yum -y install podman + mv /usr/bin/docker /usr/bin/docker_ce + ln -s /usr/bin/podman /usr/bin/docker + ''' + } + } + } stage ('unit test') { steps {