Jenkins Pipeline—使用 Jenkinsfile 文件

原文地址:Jenkins Pipeline—使用 Jenkinsfile 文件(永久地址,保存网址不迷路 🙃)

本笔记内容是对 Jenkins/Pipeline/Using a Jenkinsfile 手册的学习整理。

Table of Contents

Creating a Jenkinsfile

Build
Test
Deploy

Working with your Jenkinsfile

String interpolation

Using environment variables

Setting environment variables
Setting environment variables dynamically

Handling credentials

For secret text, usernames and passwords, and secret files

Secret text
Usernames and passwords
Secret files

 

For other credential types

Combining credentials in one step

 

Handling parameters

Handling failure

Using multiple agents

Optional step arguments

Advanced Scripted Pipeline

Parallel execution

脚本式流水中定义环境变量:

node {
    withEnv(["PATH+MAVEN=${tool 'M3'}/bin"]) {
        sh 'mvn -B verify'
    }
}

Pipeline Syntax reference

Pipeline Syntax

Pipeline Steps reference

Pipeline Steps Reference

retry - 重复执行,直至成功

Pipeline: Basic Steps/retry

retry(5){
     httpRequest(url: 'https://www.google.com')
}

相关文章

「Jenkins Pipeline」- Code conversion
「Jenkins Pipeline」- 构建Docker镜像
「Jenkins Pipeline」- Generic Webhook Trigger
「Jenkins Pipeline」- 集成 Selenium 测试
「Jenkins Pipeline」- 存储变量,以用于下次构建
「Jenkins Pipeline」- 放弃当前构建

参考文献

Jenkins/Pipeline/Using a Jenkinsfile

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值