当前位置:网站首页>【jenkins】pipeline控制多job顺序执行,进行定时持续集成
【jenkins】pipeline控制多job顺序执行,进行定时持续集成
2022-06-29 13:49:00 【bulabula2022】
1.jenkins下新建一个流水线项目

2. 编写pipeline流水线脚本
完整脚本:
pipeline {
agent any
stages {
stage("build console all") {
steps {
script {
def starting = 'pipeline-'
def ending = ""
def job_list = [
"清空blackduck平台上传的历史bdio文件",
"安全扫描flux依赖包安装",
"Coverity安全扫描多job同时运行-mvn编译方式",
"BlackDuck安全扫描多job同时运行",
"BlackDuck_BinaryScan安全扫描多job同时运行"]
def branches = [:]
MAX_CONCURRENT = 1//创建fifo
latch = new java.util.concurrent.LinkedBlockingDeque(MAX_CONCURRENT)//往fifo中,填入最大个数元素
for(int i=0; i<MAX_CONCURRENT; i++)
latch.offer("$i")for(int i=0; i<job_list.size(); i++) {
def name = starting + job_list[i] + ending
branches[name] = {
def thing = null
waitUntil {
//获取一个资源
thing = latch.pollFirst();
return thing != null;
}try {
//执行job
build(job: name, propagate: false)
}finally {
//释放一个资源
latch.offer(thing)
}
}
}timestamps {
parallel branches
}
}
}
}
}
}
3.定时构建,添加触发器
运行效果:
边栏推荐
- uniApp问题清单与经验
- 纳人才,谋发展 | 人大金仓喜获“最佳雇主校招案例奖”
- 微信小程序:图片秒加水印制作生成
- Stable currency risk profile: are usdt and usdc safe?
- Summary of binary tree exercises
- 测试用例设计方法之等价类划分方法
- Installation and removal of cover for CPU protection on desktop motherboard
- 你还在用命令看日志?快用 Kibana 吧,一张图胜过千万行日志
- Why does ETL often become ELT or even let?
- 广州开展瓶装气安全宣传活动,普及燃气安全知识
猜你喜欢

Intuition and Implementation: batch normalization

vmware虚拟机的作用

吐血整理:一份不可多得的架构师图谱!

Wechat applet: Halloween avatar box generation tool

“死掉”的诺基亚,一年躺赚1500亿

golang6 反射

Equivalence class partition method for test case design method

Investors fell off the altar: 0 sales in half a year, transferred to business and delivered takeout

TikTok全球短视频霸主地位或被YouTube反超

Turbulent intermediary business, restless renters
随机推荐
vmware虚拟机的作用
Redis fragment cluster setup and use tutorial
Redis的持久化机制
urllib urllib2
[document translation] camouflaged object detection
留给比亚迪的时间还有三年
Normalization layer of pytorch learning (batchnorm, layernorm, instancenorm, groupnorm) [easy to understand]
Teach you how to install the latest version of mysql8.0 database on windows, nanny level teaching
Thinkpad VMware 安装虚拟机出现此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态(问题解决方法)
goby全端口扫描
matplotlib直方图,柱状图
Seekg() [easy to understand]
"Dead" Nokia makes 150billion a year
布隆过滤器Bloom Filter简介
强大、优秀的文件管理软件评测:图片管理、书籍管理、文献管理
广州开展瓶装气安全宣传活动,普及燃气安全知识
MySQL 1146 error [easy to understand]
tcpdump如何对特定的tcp标志位进行过滤
[high concurrency] 28000 words' summary of callable and future interview knowledge points. After reading it, I went directly to ByteDance. Forgive me for being a little drifting (Part 1)
数字IC手撕代码--交通灯