手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

gogs配置钩子脚本,代码自动更新

时间:2024-10-12 08:28:03

1、打开仓库设置中的管理git钩子,通过配置post-receive(提交后执行)来进行自动代码更新,并自动clone项目

gogs配置钩子脚本,代码自动更新

2、在钩子文本中配置,之后每次push提交都会被触发

gogs配置钩子脚本,代码自动更新

3、#!/bin/bashroot_path='/www/xiaochengxu/project'unset $(git rev-parse --local-env-vars);mkdir -p $root_pathcd $root_path;git clone [email protected]:xiaochengxu/project.git $root_pathif [ $? = 0 ]; then chown -R 1000:100 $root_path && chmod -Rf g+s $root_path && chmod -R 775 $root_pathfigit checkout .;git pull origin master;

gogs配置钩子脚本,代码自动更新

4、最终代码自动生成到指定的root_path目录

gogs配置钩子脚本,代码自动更新
© 手抄报圈