如何实现Jenkins 编译结果通知到QQ好友及QQ群组<很遗憾 2019年1月1日腾讯停止了webqq机器人的服务支持>...

Jenkins-NotifyQQ

NotifyQQ 运行于Docker 本文介绍mac 环境下实现Jenkins编译结果QQ即时通知 Jenkins 安装使用及iOS自动化打包,邮件通知请参考本人博客:http://www.cnblogs.com/zhujin/p/9064820.html

本文重点讲如何实现Jenkins 编译结果通知到QQ好友及QQ群组。相比邮件通知更及时。

一、安装Docker

https://docs.docker.com/docker-for-mac/install/  或者自己找免费下载的资源

Docker 常用命令:

docker images #看镜像
docker ps -n 5 #查看容器
Docker stop idNun #停止容器
docker logs Mojo-Webqq #查看日志
docker run 0eba3bfe94c4 #imageID
. 删除前需要保证容器是停止的  stop
. 需要注意删除镜像和容器的命令不一样。 docker rmi ID  ,其中 容器(rm)  和 镜像(rmi)
. 顺序需要先删除容器
可以使用Docker save和Docker load命令来存储和载入镜像。
. docker save -o webqq.tar webqq
. docker load <webqq.tar

.将镜像存储

docker save webqq > /root/docker-images/webqq.tar

.导入镜像文件

docker load --input /root/docker-images/webqq.tar

.通过符号的方式来导入

docker load < /root/docker-images/webqq.tar

二、安装NotifQQ

地址:https://github.com/zhujin001032/Jenkins-NotifyQQ

1.克隆 https://github.com/zhujin001032/Jenkins-NotifyQQ.git 到本地

2.在NotifyQQ的根目录里面执行

docker build -t webqq .

3.启动

docker run -it --env MOJO_WEBQQ_LOG_ENCODING=utf8 -p 5000:5000 -v /tmp:/tmp webqq 

4.启动后根据提示打开二维码,手机QQ打开小号扫码登录。相信你懂的

三、安装 changelog-environment-plugin 插件

下载的源码中包含 

     changelog-environment.hpi 

     可以直接使用

四、编译jenkins QQ通知插件

使用Maven构建,即

mvn compile hpi:hpi

最终输出NotifyQQ.hpi、NotifyQQ.jar文件,在Jenkins插件管理高级上传安装NotifyQQ.hpi重启Jenkins即可。

下载的源码中包含: NotifyQQChangelogMessage.hpi 可以直接使用

五、截图

  • docker 启动webqq 扫码登录 

  • Jenkin构建环境 设置log格式 

  • Jenkin构建后 QQ通知 设置 

  • QQ通知成功发出

  •  

特别说明:

源代码 参考于: https://github.com/ameizi/NotifyQQ 其给出的插件是依据QQ号或者群号发送消息的,但是现在只能用qq昵称或者群昵称发送消息,因此修改了https://github.com/ameizi/NotifyQQ 源码。 现实通过QQ昵称发消息,并增加了获取svn或者git 修改日志变量至QQ通知消息中。

更多参考 https://github.com/zhujin001032/Mojo-Webqq

最后附上自己用的脚本 相信你懂的

转载于:https://www.cnblogs.com/zhujin/p/9482214.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<properties> <hudson.security.AuthorizationMatrixProperty> <inheritanceStrategy class="org.jenkinsci.plugins.matrixauth.inheritance.InheritParentStrategy"/> <permission>USER:hudson.model.Item.Read:anonymous</permission> </hudson.security.AuthorizationMatrixProperty> <jenkins.model.BuildDiscarderProperty> <strategy class="hudson.tasks.LogRotator"> <daysToKeep>90</daysToKeep> <numToKeep>-1</numToKeep> <artifactDaysToKeep>30</artifactDaysToKeep> <artifactNumToKeep>-1</artifactNumToKeep> </strategy> </jenkins.model.BuildDiscarderProperty> <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.7.7"> <gitLabConnection>src.ift.run</gitLabConnection> <jobCredentialId/> <useAlternativeCredential>false</useAlternativeCredential> </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty> <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.34"> <autoRebuild>false</autoRebuild> <rebuildDisabled>false</rebuildDisabled> </com.sonyericsson.rebuild.RebuildSettings> <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.11"> <maxConcurrentPerNode>3</maxConcurrentPerNode> <maxConcurrentTotal>0</maxConcurrentTotal> <categories class="java.util.concurrent.CopyOnWriteArrayList"/> <throttleEnabled>true</throttleEnabled> <throttleOption>project</throttleOption> <limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams> <paramsToUseForLimit/> <configVersion>1</configVersion> </hudson.plugins.throttleconcurrents.ThrottleJobProperty> <jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl plugin="branch-api@2.1071.v1a_188a_562481"> <durationName>hour</durationName> <count>40</count> <userBoost>true</userBoost> </jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl> </properties> 这是jenkin中 job定义中的一段,请解释这一段的含义
07-14

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值