#!/bin/bash # 更新代码 cd /code && git fetch origin $PROGINN_BRANCH cd /code && git checkout -f origin/$PROGINN_BRANCH cd /proginn-user && git fetch origin dev cd /proginn-user && git checkout -f origin/dev cd /proginn-bituni && git fetch origin dev cd /proginn-bituni && git checkout -f origin/dev cd /boss && git fetch origin $ROOTER_BRANCH cd /boss && git checkout -f origin/$ROOTER_BRANCH cd /proginn-frontend && git fetch origin $PROGINN_FRONTEND_BRANCH cd /proginn-frontend && git checkout -f origin/$PROGINN_FRONTEND_BRANCH cd /proginn-frontend && current_git_branch_latest_id=`git rev-parse HEAD` current_git_branch_last_id=`cat /var/www/.proginn-frontend-commit-id` if [[ "$current_git_branch_latest_id" != "$current_git_branch_last_id" ]]; then echo "$current_git_branch_latest_id" > /var/www/.proginn-frontend-commit-id # cd /proginn-frontend && rm -rf node_modules && npx yarn --registry=https://registry.npm.taobao.org install cd /proginn-frontend && pm2 reload ecosystem.config.yml fi