//脚本文件信息
#!/bin/bash
if [ $1 == "all" ];then
for srv in `ls api`; do
echo "开始更新api $srv"
/usr/local/go/bin/go build -o "./bin/api-"$srv "./api/"$srv && sudo supervisorctl restart "api-$srv"
done
for srv in `ls srv`; do
echo "开始更新srv $srv"
/usr/local/go/bin/go build -o "./bin/srv-"$srv "./srv/"$srv && sudo supervisorctl restart "srv-$srv"
done
else
echo "开始更新$1 $2"
/usr/local/go/bin/go build -o "./bin/$1-"$2 "./$1/"$2 && sudo supervisorctl restart "$1-$2"
fi
//配置文件信息
[program:api-activity]
command= /home/taodf/go/src/git.liyula.net/shanxing/ts-core/bin/api-activity - c dev
autostart=true
autorestart=true
startretries=10
redirect_stderr=true
stdout_logfile=/home/taodf/logs/api-activity.log