环境
CentOS Linux release 7.6.1810
jdk1.8.0_65
apache-tomcat-8.5.45
Jenkins-2.235.5
apache-maven-3.6.3
git-2.9.5
gradle-6.6.1
SonarQube-6.7.7(LTS)
sonar-scanner-cli-4.2.0.1873
拓扑:
node1:安装GitLab、SonarQube
node2:安装Jenkins、Git、MAVEN
一、小团队自动化运维实践经验
1、先做监控和告警
Prometheus用于监控告警、Grafana用于展示。
2、一开始就应该做配置版本化
3、Jenkins化:将构建打包交给Jenkins
4、将制品交给Nexus管理
5、使用Ansible执行部署
二、ChatOps
将重复性的手工操作自动化了,通过ChatOps可以自助实现一些简单的运维。
Rocket.Chat作为聊天窗口实现,依赖于MongoDB;Hubot作为运维机器人,hubot是github出品的一个运维机器人。本质就是一个接收命令消息,执行预定义操作的一个程序。而接收命令消息的这个组件在hubot中被称为adapter,eg:rocketChat的adapter:hubot。市面上已经有很多了。hubot接收命令后如何执行就需要我们来实现了。Jenkins实现任务执行,整体架构如下:
1、安装Rocket.Chat
(1)cetos7安装Rocket.Chat
官方手册:https://docs.rocket.chat/installation/manual-installation/centos/
网友参考:https://blog.csdn.net/qq_38041439/article/details/104391064
(2)管理界面使用
参考:指导 https://www.cnblogs.com/zhangxingeng/p/11418803.html
https://blog.51cto.com/1010598/2517103
(3)客户端使用
参考:指导 https://www.cgspread.com/9876.html
2、安装Hubot
3、整合Rocket.Chat、Hubot、Jenkins
参考:在RocketChat的聊天窗口命令hubot执行一次jenkins构建任务。
https://www.cnblogs.com/fengzhihai/p/10330683.html
原文:https://www.cnblogs.com/cac2020/p/13712210.html