{"id":663,"date":"2023-02-26T13:56:40","date_gmt":"2023-02-26T05:56:40","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=663"},"modified":"2023-04-29T18:42:17","modified_gmt":"2023-04-29T10:42:17","slug":"jenkins-parameterized-construction","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/jenkins-parameterized-construction\/","title":{"rendered":"Jenkins\u53c2\u6570\u5316\u6784\u5efa"},"content":{"rendered":"<h2>\u8bbe\u7f6e\u53c2\u6570<\/h2>\n<p>General -&gt; \u53c2\u6570\u5316\u6784\u5efa\u8fc7\u7a0b -&gt; <code>Add Parameter<\/code> -&gt; \u9009\u9879\u53c2\u6570<\/p>\n<p><!-- more --><\/p>\n<ul>\n<li>Name: <code>operate<\/code><\/li>\n<li>Choices:<\/li>\n<\/ul>\n<pre><code>start\nstop<\/code><\/pre>\n<h2>\u53c2\u6570\u53d6\u503c<\/h2>\n<pre><code>cd deploy\/appblog-elastalert\nsh .\/deploy.sh ${operate}<\/code><\/pre>\n<pre><code>#!\/bin\/bash\npid=`ps -ef | grep python | grep elastalert | awk &#039;{print $2}&#039;`\necho $pid\necho $1\nif [ $1 == &#039;start&#039; ]; then\n    if [ -n &quot;$pid&quot; ]; then\n        kill -9 $pid\n    fi\n    nohup python -m elastalert.elastalert --start NOW --verbose  --rule \/home\/appblog\/elastalert\/appblog.yaml --config \/home\/appblog\/elastalert\/config.yaml &gt; \/dev\/null 2&gt;&amp;1 &amp;\nelif [ $1 == &#039;stop&#039; ]; then\n    if [ -n &quot;$pid&quot; ]; then\n        kill -9 $pid\n    fi\nfi<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8bbe\u7f6e\u53c2\u6570 General -&gt; \u53c2\u6570\u5316\u6784\u5efa\u8fc7\u7a0b -&gt; Add Parameter -&gt; \u9009\u9879 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[92],"class_list":["post-663","post","type-post","status-publish","format-standard","hentry","category-ci-cd","tag-jenkins"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=663"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/663\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}