Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

Jenkins参数化构建

设置参数

General -> 参数化构建过程 -> Add Parameter -> 选项参数

  • Name: operate
  • Choices:
start
stop

参数取值

cd deploy/appblog-elastalert
sh ./deploy.sh ${operate}
#!/bin/bash
pid=`ps -ef | grep python | grep elastalert | awk '{print $2}'`
echo $pid
echo $1
if [ $1 == 'start' ]; then
    if [ -n "$pid" ]; then
        kill -9 $pid
    fi
    nohup python -m elastalert.elastalert --start NOW --verbose  --rule /home/appblog/elastalert/appblog.yaml --config /home/appblog/elastalert/config.yaml > /dev/null 2>&1 &
elif [ $1 == 'stop' ]; then
    if [ -n "$pid" ]; then
        kill -9 $pid
    fi
fi
上一篇 Windows下安装OpenSSH
下一篇 云服务器挂载数据盘