-
Notifications
You must be signed in to change notification settings - Fork 6
자동배포
박재윤 edited this page Nov 26, 2020
·
1 revision
#!/bin/bash
# 현재 경로 가져오기
DIRECTORY=$(dirname $(realpath $0))
# 경로 변경
cd ${DIRECTORY}
git fetch
# 현재 체크섬과 origin 체크섬 비교
CUR_CHECKSUM=$(git rev-parse HEAD)
ORIGIN_CHECKSUM=$(git rev-parse origin/release)
if [ $CUR_CHECKSUM == $ORIGIN_CHECKSUM ];then
exit;
fi
# 다르면 pull
git pull
npm install
date >> ${DIRECTORY}/deploy.log
echo "pull" >> ${DIRECTORY}/deploy.log
exit
cronetab -e
* * * * *
분(0-59) 시간(0-23) 일(1-31) 월(1-12) 요일(0-7)
# 매분 test.sh 실행
* * * * * /home/script/test.sh
# 매주 금요일 오전 5시 45분에 test.sh 를 실행
45 5 * * 5 /home/script/test.sh
pm2 start app.js —name "project name" —watch --node-args="--production --port=3000"