#!/bin/bash # hostnamectl source /etc/profile go version cd /root/go_path/src/job-moment git pull origin product -f ###########################招聘 go build -o ../job.sh # 日志清空 备份上次的 cp ../job.log ../job.log.copy # 端口进程结束 netstat -anp|grep 8008|awk '{print $7}'|awk -F '/' '{print $1}'|xargs kill -s 9 nohup ../job.sh >>../job.log 2>&1 & ###########################招聘 go build -o ../job.sh # 日志清空 备份上次的 cp ../job.log ../job.log.copy # 端口进程结束 netstat -anp|grep 8008|awk '{print $7}'|awk -F '/' '{print $1}'|xargs kill -s 9 nohup ../job.sh -yaml-name=job >>../job.log 2>&1 & ###########################婚纱摄影 cp ../married.log ../married.log.copy # 端口进程结束 netstat -anp|grep 8009|awk '{print $7}'|awk -F '/' '{print $1}'|xargs kill -s 9 nohup ../job.sh -yaml-name=married >>../married.log 2>&1 & ###########################白菜 cp ../baicai.log ../baicai.log.copy # 端口进程结束 netstat -anp|grep 8010|awk '{print $7}'|awk -F '/' '{print $1}'|xargs kill -s 9 nohup ../job.sh -yaml-name=baicai>>../baicai.log 2>&1 & ###########################祭扫 cp ../jisao.log ../jisao.log.copy # 端口进程结束 netstat -anp|grep 8011|awk '{print $7}'|awk -F '/' '{print $1}'|xargs kill -s 9 nohup ../job.sh -yaml-name=jisao>>../jisao.log 2>&1 & #部署前端 rm -f /www/wwwroot/zp.beikezhaoche.cn/index.html rm -rf /www/wwwroot/zp.beikezhaoche.cn/assets/* cp -r /root/go_path/src/job-moment/web/dist/* /www/wwwroot/zp.beikezhaoche.cn/