jenkins使用github的项目(springboot)进行构建配置例子

jenkins使用github的项目(springboot)进行构建配置例子

 

1.将springboot项目上传到github

如何上传参考如下连接

https://www.cnblogs.com/hxlasky/p/19199599

建议在项目的resources目录下创建一个Jenkinsfile文件,方便管理,后面采用pipeline构建时候选择"Pipeline script from SCM" 构建

 

2.准备Jenkinsfile

若原来项目中没有Jenkinsfile可以直接在github上创建

我这里仅仅是测试,仅输出一行语句,实际构建要写相应的逻辑

image

 

pipeline{agent anystages{stage("代码下载进度"){steps{script{echo "pipeline test!"}}}}
}

 

 

 

3.创建pipeline构建任务

git配置

image

 

image

 

配置完成后保存,点击"立即构建"

image