《Pro Continuous Delivery With Jenkins 2.0》随书笔记
今天同时看完《Pro Continuous Delivery With Jenkins 2.0》,
这书与工作关系很大,但也是快速翻翻。
本书着重点jenkins高可用环境搭建,与github,k8s的集成。
如果是新手,baby step方式,很有亲和力。
于我,收获一个成熟的pipeline script.

node('docker_it') {
stage('Poll') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations:
false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'github-account',
url: 'https://github.com/pro-continuous-delivery/hello-world-greeting.git']]])
}
stage('Build'){
sh 'mvn clean verify -DskipITs=true';
}
stage('Static Code Analysis'){
sh 'mvn clean verify sonar:sonar';
}
stage ('Integration Test'){
sh 'mvn clean verify -Dsurefire.skip=true';
}
stage ('Publish to Artifactory'){
def server = Artifactory.server 'Default Artifactory Server'
def uploadSpec = """{
"files": [{
"pattern": "target/hello-0.0.1.war",
"target": "helloworld-greeting-project/${BUILD_NUMBER}/",
"props": "Integration-Tested=Yes;Performance-Tested=No"
}]
}"""
server.upload(uploadSpec)
}
stash includes: 'target/hello-0.0.1.war,src/pt/Hello_World_Test_Plan.jmx', name: 'binary'
}
node('docker_pt') {
stage ('Start Tomcat'){
sh '''cd /home/jenkins/tomcat/bin
./startup.sh''';
}
stage ('Deploy to Testing Env'){
unstash 'binary'
sh 'cp target/hello-0.0.1.war /home/jenkins/tomcat/webapps/';
}
stage ('Performance Testing'){
sh '''cd /opt/jmeter/bin/
./jmeter.sh -n -t /home/jenkins/workspace/helloworld-greeting-cd/src/pt/Hello_World_
Test_Plan.jmx -l /home/jenkins/workspace/helloworld-greeting-cd/test_report.jtl''';
step([$class: 'ArtifactArchiver', artifacts: '**/*.jtl'])
}
stage ('Promote build in Artifactory'){
withCredentials([usernameColonPassword(credentialsId: 'artifactory-account', variable:
'credentials')]) {
sh 'curl -u${credentials} -X PUT "http://172.17.8.108:8081/artifactory/api/storage/
helloworld-greeting-project/${BUILD_NUMBER}/hello-0.0.1.war?properties=Performance-
Tested=Yes"';
}
}
}
《Pro Continuous Delivery With Jenkins 2.0》随书笔记的更多相关文章
- openStack CI(Continuous interaction)/CD(Continuous delivery) Gerrit/Jenkins安装及集成,插件配置
preFace: CI/CD practice part contains the following action items and fields of expertise: Gerrit ins ...
- Jenkins实现CI(Continuous Integration)到CD(Continuous Delivery)
Pipeline as Code是2.0的精髓所在,是帮助Jenkins实现CI(Continuous Integration)到CD(Continuous Delivery)华丽转身的关键推手.所谓 ...
- Go as continuous delivery tool for .NET
http://simon-says-architecture.com/2014/02/28/go-as-continuous-delivery-tool-for-net/ Following my p ...
- 解决Jenkins 2.0 初始化界面卡住的问题
***************************************** *原创博客转载请注明出处,谢谢!* **************************************** ...
- Jenkins 2.0 要来了
Jenkins 在2016/02/29日发布了2.0 alpha版本,https://jenkins-ci.org/2.0/ , 改进界面,向前兼容,增加新功能: 1.初始化时可以选择推荐插件或自定义 ...
- 关于CI/CD/CD (Continuous Integration/Continuous Delivery/Continuous Deployment)
Continuous Integration (CI) Continuous integration (CI) is the process that ensures the stability of ...
- cocos2d-x 3.0游戏实例学习笔记 《跑酷》 完结篇--源代码放送
说明:这里是借鉴:晓风残月前辈的博客,他是将泰然网的跑酷教程,用cocos2d-x 2.X 版本号重写的,眼下我正在学习cocos2d-X3.0 于是就用cocos2d-X 3.0重写,并做相关笔记 ...
- 《玩转Django2.0》读书笔记-探究视图
<玩转Django2.0>读书笔记-探究视图 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 视图(View)是Django的MTV架构模式的V部分,主要负责处理用户请求 ...
- 《玩转Django2.0》读书笔记-编写URL规则
<玩转Django2.0>读书笔记-编写URL规则 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. URL(Uniform Resource Locator,统一资源定位 ...
随机推荐
- 微信小程序特性总结
一. 小程序不是运行在浏览器中, 所以没有BOM和DOM对象 即console.log(window)和console.log(document)是获取不到任何内容的 二. 小程序特有的额外js成员( ...
- node.js与mysql数据库的交互
我们已经建好了数据库也建好了表,现在我们想查询数据库表中的内容,应该怎么做呢? 代码如下: var mysql = require('mysql'); //导入mysql包模块 var connect ...
- 使用PAC文件来管理代理连接
生成PAC文件 谷歌浏览器插件商店安装SwitchyOmega,找到立即更新模式,然后导出PAC文件 使用PAC文件 pac采用js编写 Windows Windows上面使用PAC文件很简单,新建一 ...
- docker环境下数据库的备份(postgresql, mysql)
posgresql 备份/恢复 mysql 备份/恢复 补充 posgresql 备份/恢复 备份 DATE=`date +%Y%m%d-%H%M` BACK_DATA=xxapp-data-${DA ...
- Qt对话框之二:模态、非模态、半模态对话框
一.模态对话框 模态对话框:阻塞同一应用程序中其它可视窗口输入的对话框.模态对话框有自己的事件循环,用户必须完成这个对话框中的交互操作,并且关闭了它之后才能访问应用程序中的其它任何窗口. 显示模态对话 ...
- Loj #3111. 「SDOI2019」染色
Loj #3111. 「SDOI2019」染色 题目描述 给定 \(2 \times n\) 的格点图.其中一些结点有着已知的颜色,其余的结点还没有被染色.一个合法的染色方案不允许相邻结点有相同的染色 ...
- oracle查看执行计划入门
基于Oracle的应用系统很多的性能问题都是由应用系统的SQL性能低劣引起的,因此SQL的性能优化非常重要.要分析与优化SQL的性能,一般是通过查看该SQL的执行计划,然后通过执行计划有针对性地对SQ ...
- 《 .NET并发编程实战》实战习题集 - 1 - 隔离副作用
先发表生成URL以印在书里面.等书籍正式出版销售后会公开内容.
- HTML5新标签和CSS伪类
HTML5提供了很多新的标签,由于HTML5的兼容性比较差,HTML5的标签常用于手机端 <nav> <footer> <section> <header&g ...
- EF 通过导航添加数据
Fluent Api是指定模型与数据库表之间的对应关系 //一对多 this.HasOptional(x => x.主表).WithMany(x => x.多表).HasForeignKe ...