代码跑局域网内,没有外网~无法从 git 拉代码,除了删了然后复制有啥比较方便的操作?谢谢~

代码跑局域网内,没有外网~无法从 git 拉代码,除了删了然后复制有啥比较方便的操作?谢谢~
1 yuhr123 May 11, 2019 把 git 也建在内网 |
3 qiukun May 11, 2019 via Android 写成 sh |
4 tomczhen May 11, 2019 自己打成发行版支持的安装包格式,也可以参考一些跨发行版方案,比如 appimage 之类的。 |
5 ksupertu May 11, 2019 via iPhone 打包 docker image 导来导去 |
11 xpresslink May 11, 2019 我以前做过类似的项目,服务器和开发机都是在同一个局域网内。 直接在服务器上安装 Git 服务,然后初始化一个空的 git 远程仓库。 在开发机上把代码直接 push 到服务器远程仓库。 在远程仓库的写个 post-receive 钩子脚本,用来在 push 新代码后自动触发事件,自动更新代码和重启服务。 钩子脚本很简单 # ======================================= #!/bin/bash # File_Name=post-receive # git 用来 push 后部署代码到网站的钩子 # put this file under git-repo/project.git/hooks/ and chmod +x webdir='/webapps/djangosite' gitdir='/home/gitrepo/djangosite.git' git --work-tree=$webdir --git-dir=$gitdir checkout -f chmod +x $webdir/*.sh $webdir/run.sh restart # ======================================== run.sh 是重启服务的脚本。 |
13 julyclyde May 13, 2019 推和拉的选择,很大程度上受限于网络通信 |