1 Star 0 Fork 0

keyon/jenkins-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Jenkinsfile 2.26 KB
一键复制 编辑 原始数据 按行查看 历史
keyon 提交于 2024-11-02 21:58 . 修改jenkinsfile
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)]) }
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kzj9537/jenkins-demo.git
git@gitee.com:kzj9537/jenkins-demo.git
kzj9537
jenkins-demo
jenkins-demo
master

搜索帮助