Linux自动构建部署

gogs安装配置

https://www.cnblogs.com/grimm/p/14134764.html
https://www.cnblogs.com/hoxis/p/11462959.html

为gogs建立一个系统账户
sudo useradd git

添加用户后需要修改一下/etc/sudoers
## Allow root to run any commands anywhere
root ALL=(ALL) ALL # 这个是系统原有的
git ALL=(ALL) NOPASSWD:ALL
NOPASSWD:ALL 表示执行sudo不需要用户密码

给用户分配权限
su git 切换为git用户,我操作的时候发现切换为git用户,默认的home 属于root 组及root用户,git用户没有操作权限,这个时候我们就需要把home改为git及对应的组
chown git:git /home/git

gogs下载地址
https://dl.gogs.io/

 

 

我这里使用的是Centos7所以就用到scripts/systemd/gogs.service启动脚本,需要进行以下操作。
cp scripts/systemd/gogs.service /etc/systemd/system

复制好启动脚本后,就执行它
sudo systemctl start gogs.service # 启动服务

如果需要开机启动话执行:
sudo systemctl enable gogs.service

查看服务运行状态
sudo systemctl status gogs.service


安装mysql5.7 本次安装密码FquhflMXa6/f
https://blog.csdn.net/weixin_33143629/article/details/112118787
root密码
Ilife20211022.
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Ilife20211022.';

执行以下命令开启远程访问限制(注意:下面命令开启的IP是 192.168.16.8,如要开启所有的,用%代替IP)
grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option;
grant all privileges on *.* to 'root'@'%' identified by 'Ilife20211022.' with grant option;


jk配置自动构建
https://www.cnblogs.com/stulzq/p/8629720.html
推送地址的格式为:http(s)://<你的Jenkins地址>/gogs-webhook/?job=<你的Jenkins任务名>

 

posted @ 2022-06-15 16:26  隔壁小王0918  阅读(17)  评论(0编辑  收藏  举报