jenkins创建multibranch pipeline

时间:2024-04-15 09:44:18

参考以下文章进行实践:

https://jenkins.io/doc/pipeline/tour/hello-world/#what-is-a-jenkins-pipeline

(看见一个介绍的还不错的,https://www.cnblogs.com/cay83/p/7542442.html)

step1

创建项目,分支源中填写svn信息,用户名,密码

jenkins创建multibranch pipeline

step2

新建一个branch目录,准备pipleline构建的条件。

jenkins创建multibranch pipeline

jenkins创建multibranch pipeline

Jenkinsfile内容:

pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'echo "Hello World"'
sh '''
echo "Multiline shell steps works too"
ls -lah
'''
}
}
}
}

step3:

进行构建。

jenkins创建multibranch pipeline

jenkins创建multibranch pipeline

jenkins创建multibranch pipeline

可以看到,正常输出了。