首页 > Web开发 > 详细

git--gogs自动部署到web

时间:2018-05-14 19:37:18      阅读:341      评论:0      收藏:0      [点我收藏+]

1.先找到服务器仓库的地址

技术分享图片

 

 新建post-receive文件

#!/usr/bin/env bash
"C:/python/gogs/gogs.exe" hook --config=‘C:/python/gogs/custom/conf/app.ini‘ post-receive

[python] view plain copy
#!/bin/sh

#author: embbnux
#Blog of Embbnux: http://www.embbnux.com

#判断是不是远端仓库
IS_BARE=$(git rev-parse --is-bare-repository)
if [ -z "$IS_BARE" ]; then
echo >&2 "fatal: post-receive: IS_NOT_BARE"
exit 1
fi

unset GIT_DIR
DeployPath="C:/python/platform_qa_test" //web端路劲

echo "==============================================="
cd $DeployPath
echo "deploying the test web"

#git stash
#git pull origin master
git fetch --all
git reset --hard origin/master

time=`date`
echo "web server pull at webserver at time: $time."
echo "================================================"

 IDE  push一次,就ok了

git--gogs自动部署到web

原文:https://www.cnblogs.com/hjm-hjm/p/9037612.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!