代码拉取完成,页面将自动刷新
// gitlab credential
def git_auth = "848ca7f1-2ba7-4850-b88b-39c72c7fa5df"
// the tag version of image
def tag = "latest"
// harbor server address
def harbor_url = "192.168.255.102:5000/course_project"
// harbor auth
def harbor_auth = ""
def project_name_4_image = "course:v1"
node {
stage('pull project code 01') {
checkout scmGit(
branches: [[name: '*/master']],
extensions: [],
userRemoteConfigs: [[
credentialsId: "${git_auth}",
url: 'git@192.168.255.100:base_tutorials/course.git'
]]
)
}
//stage('SonarQube code audit 02'){
// environment{
// JDK_HOME = tool 'jdk17'
// SCANNER_HOME=tool 'Sonar-Scanner'
// }
// script{
// withSonarQubeEnv('SonarQube-Server'){
// withEnv(["PATH+JDK=${JDK_HOME}/bin", "PATH+SONARQUBE=${SCANNER_HOME}/bin"]) {
// // jvm param
// sh "sonar-scanner -Dsonar.jvmOpts='--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.net.util=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED'"
// }
// // has configed in system config
// sh"${SCANNER_HOME}/bin/sonar-scanner"
// }
// }
//}
stage('package build image 03') {
// compile,install common jar
sh "mvn clean -Dmaven.skip.test=true install"
// more than one dockerfile:build ,this is used to build specified module image
sh "mvn -f course-test/pom.xml clean package dockerfile:build"
sh "docker tag course-test:0.0.1-SNAPSHOT ${harbor_url}/${project_name_4_image}"
}
// stage('push image to Harbor 04') {
// sh "docker tag course-test:0.0.1-SNAPSHOT ${harbor_url}/${project_name_4_image}"
// }
// stage('remote publish war 04') {
// steps {
// deploy adapters: [
// tomcat8(
// credentialsId: '9fbd4fd5-19a7-45c2-a275-622fa4dfc6d1',
// path: '',
// url: 'http://192.168.255.102:8080'
// )
// ],
// contextPath: null,
// war: 'target/*.war'
// }
// }
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。