「Jenkins Pipeline」- 使用 Jenkinsfile 文件(学习笔记) @20210415

本笔记内容是对 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'
    }
}

相关文章

「Jenkins Pipeline」- 在构建过程中,提示用户输入
「Jenkins Pipeline」- 隐藏 Pipeline 日志
「Jenkins Pipeline」- 在 Jenkinsfile 中使用共享库
「Jenkins Pipeline」- 相关插件及编程实践
「流水线模型」

参考文献

Jenkins/Pipeline/Using a Jenkinsfile


posted @ 2021-04-15 21:36  研究林纳斯写的  阅读(356)  评论(0编辑  收藏  举报