【Jenkins】新版本的特性:自定义流水线
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('stage-01') {
agent { label 'master' }
steps {
echo 'stage-01'
sh 'ifconfig ens33'
}
}
stage('stage-02') {
agent { label '10.91.3.213' }
steps {
echo 'stage-02'
sh 'source /etc/profile && source ~/.bash_profile && ifconfig ens33'
}
}
stage('stage-03') {
agent { label '10.91.3.214' }
steps {
echo 'stage-03'
sh 'source /etc/profile && source ~/.bash_profile && ifconfig ens33'
}
}
stage('stage-04') {
steps {
script {
// labels for Jenkins node types we will build on
def labels = ['master', '10.91.3.213', '10.91.3.214']
def builders = [:]
for (x in labels) {
def label = x // Need to bind the label variable before the closure - can't do 'for (label in labels)'
// Create a map to pass in to the 'parallel' step so we can fire all the builds at once
builders[label] = {
node(label) {
// build steps that should happen on all nodes go here
echo 'stage-04 running on: ' + label
// sh 'source /etc/profile && source ~/.bash_profile && echo "stage-04 running on all nodes"'
}
}
}
parallel builders
}
}
}
}
}
【Jenkins】新版本的特性:自定义流水线的更多相关文章
- GitLab集成Jenkins、Harborn构建pipeline流水线任务
一.计划 在jenkins中构建流水线任务时,从GitLab当中拉取代码,通过maven打包,然后构建dokcer镜像,并将镜像推送至harbor当中.Jenkins中含开发.测试.生产视图,开发人员 ...
- C#开发---利用特性自定义数据导出到Excel
网上C#导出Excel的方法有很多.但用来用去感觉不够自动化.于是花了点时间,利用特性做了个比较通用的导出方法.只需要根据实体类,自动导出想要的数据 1.在NuGet上安装Aspose.Cells或 ...
- 追踪go语言(golang)的新版本新特性【摘抄】
Go 2.0 新特性展望:详细 go2.0 会有什么新特性呢?下图是一个老外的调侃,他不希望发生这样的事情(please don't make it happen).我倒是希望其中一些实现,比如泛型和 ...
- C#导出Excel-利用特性自定义数据
网上C#导出Excel的方法有很多.但用来用去感觉不够自动化.于是花了点时间,利用特性做了个比较通用的导出方法.只需要根据实体类,自动导出想要的数据 1.在NuGet上安装Aspose.Cells或 ...
- Jenkins访问路径配置自定义的相对路径
Jenkins安装时没有配置自定义的相对访问路径,例如配置的端口是29957,那访问路径就是http://localhost:29957.以下介绍把访问路径改成http://localhost:299 ...
- Java高级特性--自定义一个StringBuilder的类
案例讲解--自定义一个StringBuilder的类 一:案例设计介绍 自义一个M定yStringBuilder来实现StringBuilder的功能 二:案例设计 实现append()方法追加字符串 ...
- Jenkins使用六:搭建流水线任务
流水线可以把多个任务串起来,比如发布版本的一系列流程 配置流水线任务 构建语法为Groovy,执行3次test(job名) node { stage("test") { echo ...
- HTML5新特性——自定义滑动条(input[type="range"])
HTML 4.01 与 HTML5之间的差异 以下 input 的 type属性值是 HTML5 中新增的: color.date.datetime.datetime-local.month.week ...
- Android新版本特性以及注意事项
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 了解新版本的特性还是很有必要的,为什么这么讲呢?因为可以从应用市场对发布应用的目标API版本(targetSdkVersion值)的 ...
随机推荐
- HDU 1796 How many integers can you find 【容斥】
<题目链接> 题目大意: 给你m个数,其中可能含有0,问有多少小于n的正数能整除这个m个数中的某一个. 解题分析: 容斥水题,直接对这m个数(除0以外)及其组合的倍数在[1,n)中的个数即 ...
- P2659 美丽的序列
P2659 美丽的序列对于当前的最小值,找到最大的左右边界,然后更新答案.用单调队列确定左右边界,O(n)做法. #include<iostream> #include<cstdio ...
- [ 严重 ] my网SQL注入
RANK 80 金币 100 数据包 POST maoyan.com/sendapp HTTP/1.1Host: xxx.maoyan.comUser-Agent: Mozilla/5.0 ( ...
- Java 浮点数精度丢失
Java 浮点数精度丢失 问题引入 昨天帮室友写一个模拟发红包抢红包的程序时,对金额统一使用的 double 来建模,结果发现在实际运行时程序的结果在数值上总是有细微的误差,程序运行的截图: 输入依次 ...
- pyquery 库的方法
初始化 在这里介绍四种初始化方式. (1)直接字符串 from pyquery import PyQuery as pq doc = pq("<html></html> ...
- Touch事件详解及区别,触屏滑动距离计算
移动端有四个关于触摸的事件,分别是touchstart.touchmove.touchend.touchcancel(比较少用), 它们的触发顺序是touchstart-->touchmove- ...
- C#常用字符串函数
Compare 比较字符串的内容,考虑文化背景(场所),确定某些字符是否相等 CompareOrdinal 与Compare一样,但不考虑文化背景 Format 格式化包含各种值的字符串和如何格式化每 ...
- express框架中如何只执行一次res响应操作
在做东西时候遇到一个可能会重复输出res.json的地方,重复输出会产生Error:Cannot set header after they are sent. Node.js不像c++里可以直接通过 ...
- [Python]mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
需要安装mysql connector 前往 https://dev.mysql.com/downloads/connector/python/ 下载 选择Platform independence, ...
- Codeforces.1110F.Nearest Leaf(线段树)
题目链接 \(dls\)讲过这道题,所以这不是线段树裸题吗,这场没打气气气气气=-= 现在是写着玩=v= \(Description\) 给定一棵\(n\)个点的树.\(q\)次询问,每次询问给定\( ...