Commit 4333171b by wangchengyang

Delete Jenkinsfile

parent 5f810152
Pipeline #116 failed with stage
in 0 seconds
pipeline {
agent { label 'jenkins-jnlp' }
triggers {
GenericTrigger(
genericVariables: [
[key: 'ref', value: '$.ref']
],
causeString: 'Triggered on $ref',
token: 'print-demo',
printContributedVariables: true,
printPostContent: true,
silentResponse: false,
regexpFilterText: '$ref',
regexpFilterExpression: 'refs/heads/' + BRANCH_NAME
)
}
options {
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('build') {
steps {
sh '/apache-maven-3.6.3/bin/mvn clean package -Dmaven.test.skip=true -U'
}
post {
failure {
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: "zhangjinxiao@zhiweidata.com",
sendToIndividuals: true])
}
}
}
stage('build image') {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweireach.com"
sh "docker build -t harbor.docker.zhiweireach.com/application/${env.JOB_NAME}:${env.BUILD_NUMBER} . "
}
}
post {
failure {
sh "/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 运维人员姓名 -c '镜像构建失败请登录 jenkins查看具体信息'"
}
}
}
stage('push image') {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweireach.com"
sh "docker push harbor.docker.zhiweireach.com/application/${env.JOB_NAME}:${env.BUILD_NUMBER}"
}
}
post {
failure {
sh "/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 汪成阳 '镜像上传失败请登录 jenkins查看具体信息'"
}
}
}
stage('deploy') {
steps {
sh "kubectl -n application set image deployment/print-demo print-demo=harbor.docker.zhiweireach.com/application/${env.JOB_NAME}:${env.BUILD_NUMBER} --record"
}
post {
success {
sh "/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 张金晓 -c k8spod已部署更新成功"
}
failure {
sh "/usr/local/bin/workwechatctl -p ${env.JOB_NAME} -n 汪成阳 -c 'k8spod 部署更新失败'"
}
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment