jenkins 批量修改配置文件
2024-10-18 01:48:48
jenkins 批量修改配置文件
jenkin job 修改配置
修改前配置
<runPostStepsIfResult>
<name>FAILURE</name>
<ordinal>2</ordinal>
<color>RED</color>
<completeBuild>true</completeBuild>
</runPostStepsIfResult>
修改后配置
<runPostStepsIfResult>
<name>SUCCESS</name>
<ordinal>0</ordinal>
<color>BLUE</color>
<completeBuild>true</completeBuild>
</runPostStepsIfResult>
用sed 修改方法
1、删除 <runPostStepsIfResult> 下面3行
sed -i '/<runPostStepsIfResult>/{n;d}' */config.xml;
sed -i '/<runPostStepsIfResult>/{n;d}' */config.xml;
sed -i '/<runPostStepsIfResult>/{n;d}' */config.xml;
2、在<runPostStepsIfResult> 下面添加3行
sed -i '/<runPostStepsIfResult>/a\ <name>SUCCESS<\/name>\n <ordinal>0<\/ordinal>\n <color>BLUE<\/color>' config.xml;
shell脚本
cd /app/mount_data/jenkins_home/jobs/
sed -i '/<runPostStepsIfResult>/{n;d}' */config.xml;
sed -i '/<runPostStepsIfResult>/{n;d}' */config.xml;
sed -i '/<runPostStepsIfResult>/{n;d}' */config.xml;
sed -i '/<runPostStepsIfResult>/a\ <name>SUCCESS<\/name>\n <ordinal>0<\/ordinal>\n <color>BLUE<\/color>' config.xml;
最新文章
- linux下交叉编译go项目
- 图片上传插件ImgUploadJS:用HTML5 File API 实现截图粘贴上传、拖拽上传
- ASP.NET Core开发-Docker部署运行
- linux 常见问题&;解决方案
- MYSQL-用户操作
- css3中filter的各种特效
- [转]how to split the ng-repeat data with three columns using bootstrap
- codeforces A. Dima and Continuous Line 解题报告
- centos网页乱码
- spring获取bean的时候严格区分大小写
- vs2013 设置为中文版
- Linux与Windows的8个不同
- Hive权限介绍
- c++ 名字粉碎(name mangling)
- 移动web开发框架研究
- Web QQ自动强制加好友代码
- MVC上传文件受限制
- tcpdump使用技巧
- jni 类初始化失败(nested exception is java.lang.NoClassDefFoundError)
- linux下的静态库与动态库详解