{"id":1748,"date":"2020-03-23T23:31:15","date_gmt":"2020-03-23T20:31:15","guid":{"rendered":"https:\/\/artem.services\/?p=1748"},"modified":"2020-03-23T23:33:19","modified_gmt":"2020-03-23T20:33:19","slug":"jenkins-%d0%bf%d1%80%d0%be%d0%b2%d0%b5%d1%80%d0%ba%d0%b0-%d0%b7%d0%b0%d0%b4%d0%b0%d0%bd%d0%be-%d0%bb%d0%b8-%d0%b7%d0%bd%d0%b0%d1%87%d0%b5%d0%bd%d0%b8%d0%b5-string-%d0%bf%d0%b0%d1%80%d0%b0%d0%bc","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1748","title":{"rendered":"Jenkins &#8212; \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0437\u0430\u0434\u0430\u043d\u043e \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 string \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430"},"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>&nbsp;<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u043e \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &quot;<strong>GIT_COMMIT_ID<\/strong>&quot;, \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c checkout \u043f\u043e \u0445\u0435\u0448\u0443 \u043a\u043e\u043c\u043c\u0438\u0442\u0430, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c checkout \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0432\u0435\u0442\u043a\u0438. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &quot;<strong>GIT_BRANCH_NAME<\/strong>&quot; \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 <strong>Active Choice<\/strong> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<h3>Jenkinsfile:<\/h3>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npipeline {\r\n  agent any\r\n  parameters {\r\n    string(defaultValue: '', description: 'If you need to build a specific commit, enter it in this field.', name: 'GIT_COMMIT_ID')\r\n  }\r\n  stages {\r\n    stage('Checkout') {\r\n      steps {\r\n        script {\r\n          if ( env.GIT_COMMIT_ID.isEmpty() ) {\r\n            sh &quot;echo Checkout branch: $GIT_BRANCH_NAME&quot;\r\n            checkout([\r\n              $class: &quot;GitSCM&quot;,\r\n              branches: [[name: &quot;${GIT_BRANCH_NAME}&quot;]],\r\n              userRemoteConfigs: [[url: &quot;${GIT_URI}&quot;]]\r\n            ])\r\n          }\r\n          else {\r\n            sh &quot;echo Checkout commit: $GIT_COMMIT_ID&quot;\r\n            checkout([\r\n              $class: &quot;GitSCM&quot;,\r\n              branches: [[name: &quot;${GIT_COMMIT_ID}&quot;]],\r\n              userRemoteConfigs: [[url: &quot;${GIT_URI}&quot;]]\r\n            ])       \r\n          }\r\n        }\r\n      }\r\n    }\r\n  } \r\n}  \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u043e \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &quot;GIT_COMMIT_ID&quot;, \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c checkout \u043f\u043e \u0445\u0435\u0448\u0443 \u043a\u043e\u043c\u043c\u0438\u0442\u0430, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c checkout \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0432\u0435\u0442\u043a\u0438. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &quot;GIT_BRANCH_NAME&quot; \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 Active Choice \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. Jenkinsfile:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[37],"tags":[1403,125,1409,1405],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1748"}],"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=1748"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1748\/revisions"}],"predecessor-version":[{"id":1750,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1748\/revisions\/1750"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}