【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值)的 ...
随机推荐
- AtCoder SoundHound Inc. Programming Contest 2018 E + Graph (soundhound2018_summer_qual_e)
原文链接https://www.cnblogs.com/zhouzhendong/p/AtCoder-SoundHound-Inc-Programming-Contest-2018-E.html 题目 ...
- day70 cookie & session 前后端交互分页显示
本文转载自qimi博客,cnblog.liwenzhou.com 概要: 我们的cookie是保存在浏览器中的键值对 为什么要有cookie? 我们在访问浏览器的时候,千万个人访问同一个页面,我们只要 ...
- centos7如何添加开机启动服务/脚本
一.添加开机自启服务 在centos7中添加开机自启服务非常方便,只需要两条命令(以Jenkins为例): systemctl enable jenkins.service #设置jenkins服务为 ...
- git&github快速掌握
git&github快速掌握 安装git 版本库创建 代码修改并提交 代码回滚 工作区和暂存区 撤销操作 删除操作 更多操作 Windows下安装git https://gitforwindo ...
- P1168 中位数
P1168 中位数树状数组+二分答案.树状数组就是起一个高效查询比二分出来的数小的有几个. #include<iostream> #include<cstdio> #inclu ...
- AM335X启动(转)
AM335x启动 参考文件: 1.TI.Reference_Manual_1.pdf http://pan.baidu.com/s/1c1BJNtm 2.TI_AM335X.pdf http:// ...
- SpringMVC(十二) RequestMapping使用POJO作为参数
将一个普通的JAVA类对象作为一个参数传入. POJO类Address: package com.tiekui.springmvc.pojo; public class Address { priva ...
- 2018-6-21-随笔-WEB应用程序
ASP.net Web应用程序 就是网站,就是一个可以运行.修改.变换的有界面 有后台的网站 Webservice 就是web服务 里面有好多的方法 对外提供数据的,只可以调用,本身没有任何的界面, ...
- 英语口语练习系列-C31-图书-谈论事物-白雪歌送武判官归京
book your favorite book a story in your childhood a character in film or TV 词汇 含义 备注 trend 趋势 indivi ...
- Lock锁与Condition监视器(生产者与消费者)。
/*生产者与消费者第二次敲,本人表示很郁闷,以后要经常读这个 * Condition 将Object类中的监视器(wait notify notifyAll)分解成不同的对象.例如condition_ ...