diff --git a/Jenkinsfile-online b/Jenkinsfile-online index dec0cebf..4afb3792 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 { @@ -26,30 +26,43 @@ pipeline { checkout(scm) } } - - stage ('unit test') { + + stage ('install podman') { steps { container ('maven') { - sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test' + 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('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" + stage ('unit test') { + steps { + container ('maven') { + sh 'mvn clean -o -gs `pwd`/configuration/settings.xml test' } - } - 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 { container ('maven') {