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 git@ssh.gogs.com: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配置钩子脚本,代码自动更新
  • 现货投资怎么开户交易
  • 现货白银如何挑选正规交易平台 怎么交易
  • 西式快餐店装修规范
  • 想自学美甲需要到哪里去学习【美甲DIY教程】
  • 现货黄金白银新手教程
  • 热门搜索
    肚丝汤的做法 马蹄的做法大全 草鱼的做法大全 美图秀秀怎么抠图 牛肉酱的做法 哈尔滨红肠做法 白斩鸡的做法 大葱的做法 怎么判断床上有螨虫 排骨怎么做好吃