{"id":1833,"date":"2020-04-05T14:15:45","date_gmt":"2020-04-05T11:15:45","guid":{"rendered":"https:\/\/artem.services\/?p=1833"},"modified":"2020-04-05T21:29:32","modified_gmt":"2020-04-05T18:29:32","slug":"jenkins-active-choice-checkbox-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0-%d1%81-%d0%bc%d0%b0%d1%81%d1%81%d0%b8%d0%b2%d0%be%d0%bc","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1833","title":{"rendered":"Jenkins &#8212; Active Choice: CheckBox &#8212; \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-819\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo.png\" alt=\"\" width=\"1280\" height=\"412\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo.png 1280w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-300x97.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-768x247.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-1024x330.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-954x307.png 954w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <strong>Active Choice CheckBox<\/strong>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439\u00a0 <strong>Active Choice<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0434\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0432 \u0432\u0438\u0434\u0435 <strong>CheckBox<\/strong>&#39;\u0430<\/p>\n<h3>Pipeline:<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nproperties([\r\n  parameters([\r\n    [$class: 'CascadeChoiceParameter', \r\n      choiceType: 'PT_CHECKBOX', \r\n      description: 'Select Environment',\r\n      filterLength: 1,\r\n      filterable: false,\r\n      name: 'Environment', \r\n      script: [\r\n        $class: 'GroovyScript', \r\n        script: [\r\n          classpath: [], \r\n          sandbox: false, \r\n          script: \r\n            'return[\\'Development\\',\\'QA\\',\\'Staging\\',\\'Production\\']'\r\n        ]\r\n      ]\r\n    ]\r\n  ])\r\n])\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1834\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/001.png\" alt=\"\" width=\"329\" height=\"261\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/001.png 329w, https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/001-300x238.png 300w\" sizes=\"(max-width: 329px) 100vw, 329px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u0412\u044b\u0431\u0435\u0440\u0435\u043c \u0434\u0432\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, &quot;<strong>Development<\/strong>&quot; \u0438 &quot;<strong>QA<\/strong>&quot;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1835\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/002.png\" alt=\"\" width=\"327\" height=\"263\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/002.png 327w, https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/002-300x241.png 300w\" sizes=\"(max-width: 327px) 100vw, 327px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &quot;<strong>Environment<\/strong>&quot; \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: &quot;<strong>Development,QA<\/strong>&quot;. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nString[] Env_Array = &quot;${params.Environment}&quot;.split(',');\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e <strong>Pipeline<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434<\/p>\n<h3>Pipeline:<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nproperties([\r\n  parameters([\r\n    [$class: 'CascadeChoiceParameter', \r\n      choiceType: 'PT_CHECKBOX', \r\n      description: 'Select Environment',\r\n      filterLength: 1,\r\n      filterable: false,\r\n      name: 'Environment', \r\n      script: [\r\n        $class: 'GroovyScript', \r\n        script: [\r\n          classpath: [], \r\n          sandbox: false, \r\n          script: \r\n            'return[\\'Development\\',\\'QA\\',\\'Staging\\',\\'Production\\']'\r\n        ]\r\n      ]\r\n    ]\r\n  ])\r\n])\r\n\r\npipeline {\r\n  agent any\r\n  stages {\r\n    stage('Check env') {\r\n      steps {\r\n        script {\r\n          if ( env.Environment.isEmpty() ) {\r\n            echo &quot;Environment not specified.&quot;\r\n            autoCancelled = true\r\n            error('Aborting the build.')\r\n          }\r\n          else {\r\n            echo &quot;Environment total: ${env.Environment}&quot;\r\n            String[] Env_Array = &quot;${params.Environment}&quot;.split(',');\r\n            for (x in Env_Array) {\r\n              echo &quot;ENV: ${x}&quot;\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <strong>Jenkins<\/strong> \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1836\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/003.png\" alt=\"\" width=\"511\" height=\"577\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/003.png 511w, https:\/\/artem.services\/wp-content\/uploads\/2020\/04\/003-266x300.png 266w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c Active Choice CheckBox, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439\u00a0 Active Choice, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0434\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0432 \u0432\u0438\u0434\u0435 CheckBox&#39;\u0430 Pipeline: &nbsp; \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: &nbsp; \u0412\u044b\u0431\u0435\u0440\u0435\u043c \u0434\u0432\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, &quot;Development&quot; \u0438 &quot;QA&quot; &nbsp; \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &hellip; <a href=\"https:\/\/artem.services\/?p=1833\" class=\"more-link\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u044c<span class=\"screen-reader-text\"> &quot;Jenkins &#8212; Active Choice: CheckBox &#8212; \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c&quot;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[37],"tags":[1455,1475,1471,125,581,1473],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1833"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1833"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1833\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1833\/revisions\/1845"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}