jenkins - 当新文件夹完全复制到目录时,我需要触发 Jenkins 作业
问题描述
当构建(文件夹)完全复制到目录时,我需要触发 jenkins 作业。这里构建文件夹副本需要一些时间。我的要求是等到文件夹复制完成并触发詹金斯作业。
解决方案
It can be done in a various way, Take a look at my example
pipeline {
agent any;
stages {
stage('copy') {
steps {
sh """
cp -r /path/from/copy /path/to/copy
"""
}
}
stage('other') {
steps {
rcho "I will run after copy stage is done"
}
}
}
/*
// you can take advantage of post DSL for your scenario as well
post {
success {
echo "I will run when job is success"
}
failure {
echo "I will run when the job is fail"
}
}
*/
}
推荐阅读
- html - 如何嵌入非连续的 Google 表格行?
- html - 显示/隐藏javascript函数
- c# - 如何在具有不同计时器持续时间的.net核心的后台服务中运行多个任务
- javascript - 在 AJAX 网站上使用动态注入的 Ninja Forms
- exec - Puppet:如果另一个 Exec 资源失败,如何执行 Exec 资源
- java - 如何返回 Arraylists 的对象数组
- python - RaspberryPi Python TypeError:*:'NoneType'和'float'不支持的操作数类型
- git - 如果目录被命名,GitKraken 拒绝打开本地存储库
.git - 任何解决方法? - r - R-Markdown:渲染为 PDF 并附加到现有的 PDF
- latex - 在 TeX 中使用 xcolor 渲染颜色不准确