1.添加集群
Rancher部署CI/CD

  1. 选择自定义
    Rancher部署CI/CD

3.填写集群名称,配置网络和节点,可选择默认
Rancher部署CI/CD

4.生成集群节点
Rancher部署CI/CD

5.配置企业微信通知,如编译成功、失败会自动推送消息到企业微信

Rancher部署CI/CD
Rancher部署CI/CD
Rancher部署CI/CD

6.设置代码仓库
Rancher部署CI/CD

  1. 进行gitlab认证,Rancher需要拉取代码,所以需要认证
    Rancher部署CI/CD
    选择gitlab,也可以选择github
    Rancher部署CI/CD
    gitlab中配置:
    Rancher部署CI/CD
    Rancher部署CI/CD

8.运行流水线
Rancher部署CI/CD

查看流水线执行情况:
Rancher部署CI/CD

9.编译完成后,会自动部署
部署成功后,会有一个容器在运行,可以直接访问.
Rancher部署CI/CD

10.页面访问测试:
Rancher部署CI/CD

11.代码展示
Rancher部署CI/CD

相关链接:
https://www.cnblogs.com/duwamish/p/11028185.html
https://segmentfault.com/a/1190000015724647
https://www.cnblogs.com/xzkzzz/p/8125389.html
https://juejin.im/post/5c4c12e5f265da615e05ce4c
https://www.bookstack.cn/read/rancher-v2.x/68ba29e5375fadcd.md
https://rancher2.docs.rancher.cn/docs/cluster-admin/tools/notifiers/_index/
https://github.com/rancher/pipeline-example-go/blob/master/.rancher-pipeline.yml

相关文章: