{"id":826,"date":"2019-03-05T11:48:08","date_gmt":"2019-03-05T08:48:08","guid":{"rendered":"https:\/\/artem.services\/?p=826"},"modified":"2019-03-05T18:21:15","modified_gmt":"2019-03-05T15:21:15","slug":"jenkins-%d0%bf%d1%80%d0%b8%d0%bc%d0%b5%d1%80-dsl-multibranch-pipeline","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=826","title":{"rendered":"Jenkins &#8212; \u041f\u0440\u0438\u043c\u0435\u0440 DSL Multibranch Pipeline"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"size-full wp-image-819 aligncenter\" 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\u043c\u0435\u0440 <strong>Multibranch Pipeline<\/strong> \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f <strong>DSL<\/strong> \u043c\u043e\u0434\u0443\u043b\u044f, \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c <strong>Bitbucket<\/strong> \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f \u0432\u0435\u0442\u043a\u0438: &quot;<strong>develop<\/strong>&quot;, &quot;<strong>staging<\/strong>&quot; \u0438 &quot;<strong>master<\/strong>&quot;. \u0411\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 <strong>15<\/strong> \u0441\u0431\u043e\u0440\u043e\u043a. \u0418 \u0438\u0441\u043a\u0430\u0442\u044c <strong>Jenkins<\/strong> \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438: &quot;<strong>.jenkins\/Jenkinsfile<\/strong>&quot;<\/p>\n<ul>\n<li>\u0418\u043c\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f: <strong>artem-dsl<\/strong><\/li>\n<li>\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446 (\u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430): <strong>dev<\/strong><\/li>\n<li>\u041a\u0440\u0435\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 Jenkins&#8217;\u0430 \u043a Bitbucket: <strong>svn-bibucket<\/strong><\/li>\n<\/ul>\n<pre class=\"brush: groovy; title: ; notranslate\" title=\"\">\r\nmultibranchPipelineJob('artem-dsl') {\r\n    displayName('Artem-DSL')\r\n    description('DSL test')\r\n    branchSources {\r\n        branchSource {\r\n            source {\r\n                bitbucket {\r\n                    serverUrl('https:\/\/git.artem.services')\r\n                    repoOwner('dev')\r\n                    repository('artem-dsl')\r\n                    credentialsId('svc-bitbucket')\r\n                    traits {\r\n                        headWildcardFilter {\r\n                            excludes('')\r\n                            includes('develop staging master')\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    }\r\n    configure {\r\n      def traits = it \/ sources \/ data \/ 'jenkins.branch.BranchSource' \/ source \/ traits\r\n      traits &lt;&lt; 'com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait' {\r\n          strategyId(3) \/\/ detect all branches\r\n      }\r\n    }\r\n    factory {\r\n        workflowBranchProjectFactory {\r\n            scriptPath('.jenkins\/Jenkinsfile')\r\n        }\r\n    }\r\n    orphanedItemStrategy {\r\n        discardOldItems {\r\n            numToKeep(15)\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u043c\u0435\u0440 Multibranch Pipeline \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f DSL \u043c\u043e\u0434\u0443\u043b\u044f, \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c Bitbucket \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f \u0432\u0435\u0442\u043a\u0438: &quot;develop&quot;, &quot;staging&quot; \u0438 &quot;master&quot;. \u0411\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 15 \u0441\u0431\u043e\u0440\u043e\u043a. \u0418 \u0438\u0441\u043a\u0430\u0442\u044c Jenkins \u0444\u0430\u0439\u043b \u043f\u043e \u043f\u0443\u0442\u0438: &quot;.jenkins\/Jenkinsfile&quot; \u0418\u043c\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f: artem-dsl \u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446 (\u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430): dev \u041a\u0440\u0435\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 Jenkins&#8217;\u0430 \u043a Bitbucket: svn-bibucket<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[37],"tags":[39,573,125,571],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/826"}],"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=826"}],"version-history":[{"count":3,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/826\/revisions"}],"predecessor-version":[{"id":829,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/826\/revisions\/829"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}