From 86ebc6b3c20b19681ada42ef6620acfbb954e1fa Mon Sep 17 00:00:00 2001 From: TianXin Date: Mon, 27 May 2019 14:12:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9D=91=E7=88=B9=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/publish-prod.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 shell/publish-prod.sh diff --git a/shell/publish-prod.sh b/shell/publish-prod.sh new file mode 100644 index 0000000..0948ac7 --- /dev/null +++ b/shell/publish-prod.sh @@ -0,0 +1,19 @@ +#下面是发布到生产环境的shell,截取的代码片段 +#要发布的是prod分支,😄 + +#首先切换到项目目录,往下你会发现这步好像并没有没什么用 +cd /home/app + +#干掉xx-vue目录,手法很暴力,突然想到了rm -rf / +rm -rf /home/app/xx-java +#除了速度慢点好像没啥问题... +git clone git@gitee.com:xx/xx-java.git --depth=10 + +#切换到项目目录,这步好像也没什么用 +cd /home/app/xx-java + +#这里他想切换到prod分支,但实际上git帮他创建了一个msater副本 +git checkout -B prod + +# 启动项目 然后发布的一直都是master的代码,😂(妈耶,坑爹啊) +sh /home/app/start-prod.sh \ No newline at end of file -- Gitee