admin 管理员组文章数量: 887021
2024年1月5日发(作者:ncre)
def project_url = "/***/"def gitlab_auth = "z***"def tag = "latest"def harbor_url = "192.168.*.*:9999"def harbor_project_name = "sysnthesis-cloud-dev"def imageName = "${project_name}:${tag}"node { def mvnHome stage('pull') { checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: "${gitlab_auth}", url: "${project_url}"]]]) } stage('structure') { sh "mvn -f cloud-common clean install" sh "mvn -f cloud-feign clean install" } stage('pack') { sh "mvn -f ${project_name} clean package dockerfile:build" sh "docker tag ${imageName} ${harbor_url}/${harbor_project_name}/${imageName}" } stage('uploading') { withCredentials([usernamePassword(credentialsId: '6c0f72aa-fab4-4be4-8889-*****', passwordVariable: 'password', usernameVariable: 'username')])
{ sh "docker login -u ${username} -p ${password} ${harbor_url}" sh "docker push ${harbor_url}/${harbor_project_name}/${imageName}" sh "echo 镜像上传成功" } } stage('issue') { sshPublisher(publishers: [sshPublisherDesc(configName: 'sysnthesis-cloud', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand:
"/root/sh/sysnthesiscloud/ $harbor_url $harbor_project_name $project_name $tag $port", execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) }}参数具体含义如下
over~
版权声明:本文标题:Jenkins流水线打包微服务构建docker镜像运行 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1704415802h458756.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论