本章主要讲述:pipeline的基本使用
那本章我主要讲述两种pipeline方法
1、任务中直接编写pipeline命令
2、从github中读取pipeline代码,再运行任务
Jenkins Pipeline : 是借用Unix中Pipeline思路,一种高内聚低耦合的工具,Jenkins 2.0 以上才会有,实际运行中,我们都是用解释性代码Jenkinsfile来描述
Jenkinsfile使用方法有两种:
- 1、Jenkins任务配置页面直接输入
- 2、代码发布到git后,从git上面拉下来
Jenkinsfile语法:
- 1、Declarative pipeline
- 2、Scripts pipeline


pipeline {
agent any
stages {
stage('begin') {
steps {
echo 'Hello mikasa'
}
}
}
post {
always{
echo 'good bye mikasa'
}
}
}







