Skip to content

jenkins 自动构建,通过global-shared-library 模板,进行自动生成脚本完成构建和发布

License

Notifications You must be signed in to change notification settings

yorke669/jenkins-global-shared-library

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jenkins-global-shared-library

jenkins 自动构建,通过global-shared-library 模板,进行自动生成脚本完成构建和发布

包括:拉取代码、拉取参数、根据分支合并参数、编译、镜像打包、生成k8s yaml、发布 整体思路:研发人员,只需要关注代码,填写仓库类型(java、python、web等),具体镜像的打包方法和发布环境(K8S还是普通docker启动还是直接supervisor进程管理)都是有运维和经理决定

如下图,每个jenkins任务,填写仓库地址和global-shared-library地址

构建参加放到global-shared-librar中,结构如下:

  • 仓库
    • resources 放置的项目参数,由运维维护
    • src/com/wict/jenkins 代码
    • vars jenkins调用入口

//在每个仓库中设置Jenkinsfile文件,放到最外层,内容如下:

@Library('global-shared-library') _

def map = [
wictProject:'java-service',
wictJarFile: "target/java-service.jar",
wictBuildCommand: "clean install -Dmaven.test.skip=true",
deployPort: "80",
resourcesMaxMemory: "1024Mi"

]
WictPipeline(map)
image image

PS:groovy 不熟悉,jenkins也很不好调试,代码有大量优化空间

About

jenkins 自动构建,通过global-shared-library 模板,进行自动生成脚本完成构建和发布

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Groovy 72.5%
  • Python 27.5%