Skip to content

Commit ffc20db

Browse files
committed
👌 修改部署脚本
1 parent 231caf5 commit ffc20db

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

codes/deploy/deployment.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ installGit() {
4040
copyXyzdeploy() {
4141
echo "克隆 xyzdeploy 项目到本地" | tee ${DEPLOY_LOG_PATH}
4242
rm -rf ${SOFTWARE_ROOT}*
43-
rm -rf ${XYZDEPLOY_ROOT}
44-
git clone ssh://git@git.xyz.cn:10022/dream/xyzdeploy.git ${XYZDEPLOY_ROOT}
45-
chmod -R 755 ${XYZDEPLOY_ROOT}/*
46-
cp -rf ${XYZDEPLOY_ROOT}/software ${SOFTWARE_ROOT}
47-
cp -rf ${XYZDEPLOY_ROOT}/config/ /home/xyz/
48-
cp -rf ${XYZDEPLOY_ROOT}/script/ /home/xyz/
49-
50-
sed -i 's/127.0.0.1/'"${IP}"'/g' /home/xyz/config/nginx/vmhosts/*.conf
43+
rm -rf ${DEPLOY_ROOT}
44+
git clone git@github.com:dunwu/linux-notes.git ${DEPLOY_ROOT}
45+
chmod -R 755 ${DEPLOY_ROOT}/*
46+
cp -rf ${DEPLOY_ROOT}/software ${SOFTWARE_ROOT}
47+
cp -rf ${DEPLOY_ROOT}/config/ /home/zp/
48+
cp -rf ${DEPLOY_ROOT}/script/ /home/zp/
49+
50+
sed -i 's/127.0.0.1/'"${IP}"'/g' /home/zp/config/nginx/vmhosts/*.conf
5151
}
5252

5353
initEnviromentConfig() {
@@ -56,14 +56,14 @@ initEnviromentConfig() {
5656
then
5757
cp -f /etc/profile /etc/profile.bak
5858
fi
59-
cp -f ${XYZDEPLOY_ROOT}/config/enviroment/profile /etc/profile
59+
cp -f ${DEPLOY_ROOT}/config/enviroment/profile /etc/profile
6060
source /etc/profile
6161

6262
if [ ! -f /etc/hosts.bak ]
6363
then
6464
cp -f /etc/hosts /etc/hosts.bak
6565
fi
66-
cp -f ${XYZDEPLOY_ROOT}/config/enviroment/hosts /etc/hosts
66+
cp -f ${DEPLOY_ROOT}/config/enviroment/hosts /etc/hosts
6767
sed -i 's/0.0.0.0/'"${IP}"'/g' /etc/hosts
6868
}
6969

@@ -118,6 +118,7 @@ installNodejsAndNvm() {
118118
}
119119

120120
installNtp() {
121+
echo "************************同步时钟************************" |tee -a /home/depoly.log
121122
yum install -y ntp
122123
vi /etc/crontab
123124
echo "*/30 * * * * /usr/local/bin/ntpdate 192.168.16.182" | tee /etc/crontab
@@ -145,7 +146,7 @@ setPrivilegeForUserIns() {
145146
}
146147
##############################__MAIN__########################################
147148
DEPLOY_LOG_PATH=/home/zp/log/deploy.log
148-
XYZDEPLOY_ROOT=/home/xyz/source/xyzdeploy
149+
DEPLOY_ROOT=/home/zp/source/xyzdeploy
149150
SOFTWARE_ROOT=/opt/software
150151

151152
init

0 commit comments

Comments
 (0)