【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值)的 ...
随机推荐
- php 连接redis服务器
$redis = new Redis(); //实例化 $redis->connect("local ...
- Codeforces 781C Underground Lab 构造
原文链接https://www.cnblogs.com/zhouzhendong/p/CF781C.html 题目传送门 - CF781C 题意 给定一个 n 个点 m 条边的无向连通图,请你用 k ...
- TF:TF分类问题之MNIST手写50000数据集实现87.4%准确率识别:SGD法+softmax法+cross_entropy法—Jason niu
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # number 1 to 10 ...
- goLand工程结构管理
goLand工程结构管理 转 https://www.jianshu.com/p/eb7b1fd7179e 开始之前请确保安装好了 go语言环境并配置好了gopath环境变量 1.创建一个新目录并打 ...
- centos6.5 nginx安装pcre错误
由于没有一步步记录,所以没有具体的代码和命令,就写一下过程,具体脑补一下吧~ wget下载 nginx 1.12.0后 tar解压 ./configure的时候,pcre出错 1. 按照网上的说法, ...
- MyEclipse、Eclipse使用配置及部分问题
简单总结一下myeclipse首次使用的配置,eclipse类似.总结的不是很全面,如有新的看法,欢迎下方留言. 最优设置 1.myeclipse激活 myeclipse.eclipse程序及激活工具 ...
- 解决win10 64位 + Python3 安装PyAutoIt报不是有效win32应用程序的办法
在win10 64位 + Python3的环境中,安装pyautoit第三方包的时候,报错提示为:不是有效win32应用程序.因为这个问题,进了python群,去寻求答案,却告知为,换32位的电脑,这 ...
- python数据结构之冒泡排序
冒泡排序是一种基础排序算法,在python中,我们利用列表的的方式来完成,它对列表中的元素进行重复的遍历,在遍历的同时进行比较,如果两个数没有按照我们规定的顺序进行排列,就按照我们预先设定好的是顺序或 ...
- WPF DataGrid 每行ComboBox 内容不同的设置方法
<toolkit:DataGridComboBoxColumn x:Name="DgCbcSignal" Header="信号源" SelectedIte ...
- 09树莓派一体化安装(All-In-One Installer)智能家居平台Home Assistant
2017-08-30 13:29:38 Raspberry Pi All-In-One Installer 全新安装树莓派系统(系统为官方的RASPBIAN STRETCH WITH DESKTOP, ...