代码拉取完成,页面将自动刷新
pipeline {
agent any // 指令用于指定构建运行的代理节点。
tools {
maven 'maven3'
}
stages {
stage('pull') {
steps {
echo '========================== pull from mayun =========================='
echo '输入变量开始'
echo "${model}"
echo '输入变量完成'
git credentialsId: 'mayun', url: 'https://gitee.com/kzj9537/jenkins-demo.git'
sh "pwd"
sh "ls"
}
}
stage('build jar'){
steps{
echo '========================== start build jar =========================='
sh """
mvn clean package
ls
ls target
"""
}
}
stage('push and build'){
steps{
echo '========================== start push and build =========================='
sshPublisher(publishers: [sshPublisherDesc(configName: 'txy_demo', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/pipeline/demo', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'target/demo-0.0.1-SNAPSHOT.jar'), sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/pipeline/demo', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'Dockerfile'), sshTransfer(cleanRemote: false, excludes: '', execCommand: '''docker rm -f demo_con
docker rmi demo-demo
cd /home/pipeline/demo
docker-compose up -d ''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/home/pipeline/demo', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'docker-compose.yaml')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) }
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。