#!/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】新版本的特性:自定义流水线的更多相关文章

  1. GitLab集成Jenkins、Harborn构建pipeline流水线任务

    一.计划 在jenkins中构建流水线任务时,从GitLab当中拉取代码,通过maven打包,然后构建dokcer镜像,并将镜像推送至harbor当中.Jenkins中含开发.测试.生产视图,开发人员 ...

  2. C#开发---利用特性自定义数据导出到Excel

    网上C#导出Excel的方法有很多.但用来用去感觉不够自动化.于是花了点时间,利用特性做了个比较通用的导出方法.只需要根据实体类,自动导出想要的数据  1.在NuGet上安装Aspose.Cells或 ...

  3. 追踪go语言(golang)的新版本新特性【摘抄】

    Go 2.0 新特性展望:详细 go2.0 会有什么新特性呢?下图是一个老外的调侃,他不希望发生这样的事情(please don't make it happen).我倒是希望其中一些实现,比如泛型和 ...

  4. C#导出Excel-利用特性自定义数据

    网上C#导出Excel的方法有很多.但用来用去感觉不够自动化.于是花了点时间,利用特性做了个比较通用的导出方法.只需要根据实体类,自动导出想要的数据  1.在NuGet上安装Aspose.Cells或 ...

  5. Jenkins访问路径配置自定义的相对路径

    Jenkins安装时没有配置自定义的相对访问路径,例如配置的端口是29957,那访问路径就是http://localhost:29957.以下介绍把访问路径改成http://localhost:299 ...

  6. Java高级特性--自定义一个StringBuilder的类

    案例讲解--自定义一个StringBuilder的类 一:案例设计介绍 自义一个M定yStringBuilder来实现StringBuilder的功能 二:案例设计 实现append()方法追加字符串 ...

  7. Jenkins使用六:搭建流水线任务

    流水线可以把多个任务串起来,比如发布版本的一系列流程 配置流水线任务 构建语法为Groovy,执行3次test(job名) node { stage("test") { echo ...

  8. HTML5新特性——自定义滑动条(input[type="range"])

    HTML 4.01 与 HTML5之间的差异 以下 input 的 type属性值是 HTML5 中新增的: color.date.datetime.datetime-local.month.week ...

  9. Android新版本特性以及注意事项

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 了解新版本的特性还是很有必要的,为什么这么讲呢?因为可以从应用市场对发布应用的目标API版本(targetSdkVersion值)的 ...

随机推荐

  1. Python图表数据可视化Seaborn:2. 分类数据可视化-分类散点图|分布图(箱型图|小提琴图|LV图表)|统计图(柱状图|折线图)

    1. 分类数据可视化 - 分类散点图 stripplot( ) / swarmplot( ) sns.stripplot(x="day",y="total_bill&qu ...

  2. day10.函数,函数的参数

    函数的思维导图: 老师的笔记 昨天内容概括 #组长:默写统一交给组长 #不建议看视频 #上课敲过的所有的例子 # 1.看一遍.看能不能看懂 # 2.给每一道题起一个名字或者一句描述 # 3.看着文字, ...

  3. html-背景图片

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. js里面的判断最好做到完全控制

    <li class="item"> <div id="zcdz" name="zcdz" class="mini ...

  5. Django之Models(三)

    Django之Models(三) 创建多对多关系 第一种方式:创建多对多的关系authors=models.ManyToManyField("Author") class Publ ...

  6. 分布式缓存技术redis系列(二)——详细讲解redis数据结构(内存模型)以及常用命令

    https://www.cnblogs.com/hjwublog/p/5639990.html

  7. asp.net core下的如何给网站做安全设置

    首先,我们来看下stack overflow网站的请求头文件: 可以看到一些我们熟悉或是陌生的HTTP头部文件字段.在这里我们在对HTTP输入流的头部文件中,做一些基本的防护.首先要明确,既然我们是对 ...

  8. Alpha(6/10)

    鐵鍋燉腯鱻 项目:小鱼记账 团队成员 项目燃尽图 冲刺情况描述 站立式会议照片 各成员情况 团队成员 学号 姓名 git地址 博客地址 031602240 许郁杨 (组长) https://githu ...

  9. XamarinSQLite教程添加列

    XamarinSQLite教程添加列 如果开发者想要在现有的表中添加列,并不需要删除重新创建数据表,只需要修改数据表.操作步骤如下. (1)右击需要添加列的表,单击Add column…(beta)命 ...

  10. angular笔记_6

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...