代码拉取完成,页面将自动刷新
#!/bin/sh
#
# Description:
# Script will receive 3 Arguments (Project Name, Environment, Branch)
# Various things happening here:
# 1.) Changing to the repo directory
# 2.) Resetting the local master branch to look exactly like remote origin master branch
# 3.) Clean off any files that don't need to be there
# 4.) Pull just to be doubly sure we have all the latest changes
# 5.) Switches branch to master just to be extra sure that we are on the right
# branch and our working tree has the right files.
#
# Written by: LM
#
if [[ -n "$1" ]] ; then
PROJECT_NAME=$1
else
PROJECT_NAME="lm-blog"
fi
if [[ -n "$2" ]] ; then
BRANCH=$2
else
BRANCH="master"
fi
cd /home/www/$PROJECT_NAME
git reset --hard origin/$BRANCH
git clean -f
git pull
git checkout $BRANCH
# forever stop index.js
# NODE_ENV=production forever start index.js
echo "#-----------------------------------------------#"
echo "# Execution Completed #"
echo "#-----------------------------------------------#"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。