Commit 3fc91e61 authored by mengweifu's avatar mengweifu

add:azkaban

parent a964f76c
#!/usr/bin/env bash
DIST_FILE_NAME="*.tar.gz"
PROJECT_DIR="api.go2yd.com"
START_SCRIPT="./start_env/start_job.sh"
SYNC_DATA_OPERATIONS="
tar zxf *.tar.gz -C start_env/api.go2yd.com/htdocs/Website
"
DEST_FILE_NAME=""
DEST_FILE_PATH=""
BASE_IMAGE="docker2.yidian.com:5000/centos7/php72_without_nginx:20210621"
MAINTAINER="mengweifu \"mengweifu@yidian-inc.com\""
HOME_DIR="/home/services"
LOG_DIRS="
${HOME_DIR}/${PROJECT_DIR}/logs
"
DATA_DIRS="
"
......@@ -6,14 +6,16 @@ fi
# 任务名称
if [[ X"$2" == X"" ]]; then
echo "task_name cannot be empty"
echo "controller name cannot be empty"
exit 1
fi
# method名称
if [[ X"$3" == X"" ]]; then
echo "method name cannot be empty"
exit 1
fi
start_done_file="/home/services/api.go2yd.com/logs/start_script.done"
rm -f ${start_done_file}
environment=${1}
#php.ini要根据环境去修改
......@@ -29,14 +31,6 @@ fi
rsyslogd >/dev/null 2>&1
#logrotate
cp -f /home/services/logrotate/logrotate-daemon.conf /etc/logrotate.d/goods-daemon.conf
#crontab
nohup /usr/sbin/crond >crond.nohup &
crontab /home/services/crontab/crontab-daemon.conf
# ls | grep -v 'tuiyitui.*\|ini\|recipe\|unify_start_script.sh' | xargs rm -rf
if [[ -e "/usr/share/zoneinfo/Asia/Shanghai" ]]; then
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
......@@ -50,16 +44,8 @@ sysctl -w net.core.somaxconn=65535
php api.go2yd.com/htdocs/Website/public/job.php goodstoes index "t=$2&n=$3&j=$2"
while true; do
is_master_on=$(pgrep -fc "$2 $1 master process")
if [[ ${is_master_on} -gt 0 ]]; then
if [[ ! -f "$start_done_file" ]]; then
touch ${start_done_file}
fi
sleep 10
continue
else
exit 1
fi
done
if [ $? -ne 0 ]
then
# todo
echo "Build failed"
fi
# 运行环境env
if [[ X"$1" == X"" ]]; then
echo "env cannot be empty"
exit 1
fi
# 任务名称
if [[ X"$2" == X"" ]]; then
echo "task_name cannot be empty"
exit 1
fi
# goodstoes index
php public/job.php $1 $2
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment