做外贸的人经常用什么网站,网页图片动态效果,网站设计需要什么,app开发定制公司推荐文章目录 1. Jenkins安装1.1 Jenkins Docker安装1.2 Jenkins apt-get install安装 2. 关联github/gitee服务与webhook2.1 配置ssh2.2 Jenkins关联2.3 WebHook 3. 前后端关联发布 1. Jenkins安装
1.1 Jenkins Docker安装
Docker很好#xff0c;但是我没有玩明白如何使用Docke… 文章目录 1. Jenkins安装1.1 Jenkins Docker安装1.2 Jenkins apt-get install安装 2. 关联github/gitee服务与webhook2.1 配置ssh2.2 Jenkins关联2.3 WebHook 3. 前后端关联发布 1. Jenkins安装
1.1 Jenkins Docker安装
Docker很好但是我没有玩明白如何使用Docker的jenkins发布服务。因此仅做个记录 参考https://juejin.cn/post/7219899306946199610 这篇文章详细讲述了Docker中Jenkins如果想启其他docker服务的过程值得参考 参考https://blog.csdn.net/BThinker/article/details/124178670 这篇文章详细讲述了Jenkins Docker的安装过程值得参考 1.2 Jenkins apt-get install安装
直接参考官网https://pkg.jenkins.io/debian-stable/
This is the Debian package repository of Jenkins to automate installation and upgrade. To use this repository, first add the key to your system (for the Weekly Release Line): sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \https://pkg.jenkins.io/debian-stable/jenkins.io-2023.keyThen add a Jenkins apt repository entry: echo deb [signed-by/usr/share/keyrings/jenkins-keyring.asc] \https://pkg.jenkins.io/debian-stable binary/ | sudo tee \/etc/apt/sources.list.d/jenkins.list /dev/nullUpdate your local package index, then finally install Jenkins:
sudo apt-get update
sudo apt-get install fontconfig openjdk-17-jre
sudo apt-get install jenkins上述过程执行完毕最终以systemctl的方式启动
如果要修改端口号参考https://blog.csdn.net/Lifereunion/article/details/123430619
需要用systemctl status jenkins找到配置文件然后直接在配置文件修改
借用评论区老哥的一句话 把配置写在服务里这就离谱。。。估计都是用Jenkins源下载的吧官方打包的人脑子有吭如果直接安装rpm包就不会这样。 2. 关联github/gitee服务与webhook 参考 https://www.jianshu.com/p/dca1ec8187aa。写得很好 2.1 配置ssh
gitee和github流程差不多都是本地
ssh-keygen -t rsa -C your_emailexample.com2.2 Jenkins关联
生成的id_rsa.pub放到github的配置中
生成的id_rsa放到Jenkins中 2.3 WebHook
首先去System配置关联 这里的需要配置API令牌记得自己存一份以后就看不到这个API令牌了 在流水线中选择Generic Webhook Trigger 这里通过该网站https://chahuo.com/token-generator.html随机生成一段token
按照上述url在gitee部分也进行同样设置
3. 前后端关联发布 参考https://www.cnblogs.com/gaojinshun/p/15273011.html 我用的是shell的方式发布服务
注意一定需要加入BUILD_IDdontKillMe否则jenkins默认会在构建完成后杀掉构建过程中又jenkins中shell命令触发的衍生进程。
BUILD_IDdontKillMepwd
ls -lr
sh ./kill5050.shnpm install
npm install forever -g
forever start server.js