{"id":315086,"date":"2020-12-18T09:00:19","date_gmt":"2020-12-18T09:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315086"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315086","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c Continuous Integration \u0434\u043b\u044f Jenkins \u0438 Bitbucket \u0441 werf"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fy\/s1\/i_\/fys1i_7drlxrjlxl2skt4fkzv4q.png\"><\/p>\n<p>  \u0423\u0442\u0438\u043b\u0438\u0442\u0430 <a href=\"https:\/\/ru.werf.io\/\">werf<\/a> \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0435\u0451 \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 CI\/CD-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 <i>\u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435<\/i> \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u044d\u043f\u0438\u043b\u043e\u0433\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u2014 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 CI \u0432 Jenkins \u0438 Bitbucket.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ol>\n<li> Shared Library \u0434\u043b\u044f Jenkins, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 CI \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0434\u0438\u043d\u044b\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c.<\/li>\n<li> \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Jenkins \u0441 Bitbucket, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c CI \u043f\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u043a\u0438 \u0438\u043b\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0435\u0433\u0430.<\/li>\n<\/ol>\n<p>  \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<a name=\"habracut\"><\/a><\/p>\n<h2>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Jenkins<\/h2>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u044b:<\/p>\n<ul>\n<li> Jenkins 2.249.1;<\/li>\n<li>Bitbucket Cloud;<\/li>\n<li> werf 1.1 stable;<\/li>\n<li> <a href=\"https:\/\/plugins.jenkins.io\/basic-branch-build-strategies\">Basic Branch Build Strategies Plugin<\/a> 1.3.2;<\/li>\n<li> <a href=\"https:\/\/plugins.jenkins.io\/cloudbees-bitbucket-branch-source\">Bitbucket Branch Source Plugin<\/a> 2.9.4.<\/li>\n<\/ul>\n<p>  \u0412 Jenkins \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f multibranch pipeline.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a Jenkins \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0430 <a href=\"https:\/\/www.jenkins.io\/doc\/book\/pipeline\/shared-libraries\/\">Shared Library<\/a>. Shared Library \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043a\u043e\u0434 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f CI \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 CI (\u0432\u043c\u0435\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f CI \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e <code>Jenkinsfile<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442).<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c: Manage Jenkins \u2192 Configure System \u2192 Global Pipeline Libraries.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bu\/vo\/h_\/buvoh_guvjetmfpn5b40kso-sky.png\"><\/p>\n<p>  \u041d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f, \u0432\u0435\u0442\u0432\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 Jenkins \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0432 Source Code Management \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 SSH-\u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 ReadOnly).<\/p>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 Shared Library<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0441\u0430\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u0438\u0437 \u0442\u0440\u0451\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/o8\/a3\/wo\/o8a3wot5x8nmoappaiprdvd-edc.png\"><\/p>\n<ul>\n<li> <code>vars<\/code> \u2014 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0447\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430;<\/li>\n<li> <code>src<\/code> \u2014 \u0442\u043e\u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430;<\/li>\n<li> <code>resources<\/code> \u2014 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438.<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432 Jenkins \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>vars<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0430\u043c werf, \u0447\u0442\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0441\u044c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0438\u0441\u0430\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0432 <code>Jenkinsfile<\/code> \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u0435\u043f\u043b\u043e\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 99,9% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c 2 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u044b werf \u2014 <code>-runWerf.groovy<\/code>.<\/p>\n<pre><code class=\"plaintext\">#!\/usr\/bin\/env groovy def call(String dockerCreds, String werfargs){   \/\/ \u043b\u043e\u0433\u0438\u043d \u0432 registry   \/\/ \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 - url (\u043f\u0443\u0441\u0442, \u0442.\u043a. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c DockerHub)   \/\/ \u0432\u0442\u043e\u0440\u043e\u0439 - \u0438\u043c\u044f Jenkins-\u0441\u0435\u043a\u0440\u0435\u0442\u0430, \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u044b (login, password)   docker.withRegistry(&quot;&quot;, &quot;${dockerCreds}&quot;) {     sh &quot;&quot;&quot;#!\/bin\/bash -el           set -o pipefail           type multiwerf &amp;&amp; source &lt;(multiwerf use 1.1 stable --as-file)           werf version           werf ${werfargs}&quot;&quot;&quot;.trim()     } } <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a <code>Map<\/code>, \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e:<\/p>\n<pre><code class=\"plaintext\">#!\/usr\/bin\/env groovy def call( Map parameters = [:] ) { \/\/ \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 Map \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438   def namespace = parameters.namespace \/\/ \u0438\u043c\u044f \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u0432\u044b\u043a\u0430\u0442\u0430   \/\/ \u0438\u043c\u044f \u043a\u043b\u044e\u0447\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445)   def werf_secret_key = parameters.werfCreds != null ? parameters.werfCreds : &quot;werf-secret-key-default&quot;   \/\/ \u0438\u043c\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u043d\u0430 \u0432 docker registry   def dockerCreds = parameters.dockerCreds != null ? parameters.dockerCreds : &quot;docker-credentials-default&quot;   \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u0437 \u0438\u043c\u0435\u043d\u0438 multibranch pipeline   def PROJ_NAME = &quot;${env.JOB_NAME}&quot;.split('\/').first()   \/\/ \u0438\u043c\u044f registry \u0432 docker hub \u0438\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u0434\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e registry   def imagesRepo = parameters.imagesRepo != null ? parameters.imagesRepo : &quot;myrepo&quot;   if( namespace == null ) { \/\/ \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435     currentBuild.result = 'FAILED'     return   }   pipeline {     agent { label 'werf' }     options { disableConcurrentBuilds() } \/\/ \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0434\u043b\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430     environment { \/\/ \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b werf       WERF_IMAGES_REPO=&quot;${imagesRepo}&quot;              WERF_STAGES_STORAGE=&quot;:local&quot;       WERF_TAG_BY_STAGES_SIGNATURE=true       WERF_ADD_ANNOTATION_PROJECT_GIT=&quot;project.werf.io\/git=${GIT_URL}&quot;       WERF_ADD_ANNOTATION_CI_COMMIT=&quot;ci.werf.io\/commit=${GIT_COMMIT}&quot;       WERF_LOG_COLOR_MODE=&quot;off&quot;       WERF_LOG_PROJECT_DIR=1       WERF_ENABLE_PROCESS_EXTERMINATOR=1       WERF_LOG_TERMINAL_WIDTH=95       PATH=&quot;$PATH:$HOME\/bin&quot;       WERF_KUBECONFIG=&quot;$HOME\/.kube\/config&quot;       WERF_SECRET_KEY = credentials(&quot;${werf_secret_key}&quot;)     }     triggers {       \/\/ Execute weekdays every four hours starting at minute 0       cron('H 21 * * *')      \/\/ \u0434\u043b\u044f werf cleanup, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0441\u0442\u0438\u0442\u044c registry \u0438 \u0445\u043e\u0441\u0442-\u0440\u0430\u043d\u043d\u0435\u0440 \u043e\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043a\u044d\u0448\u0435\u0439 \u0438 \u043e\u0431\u0440\u0430\u0437\u043e\u0432     }     stages {       stage('Checkout') {         steps {           checkout scm \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u0434 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f         }       }        stage('Build &amp; Publish image') {          when {             not { triggeredBy 'TimerTrigger' } \/\/ \u0447\u0442\u043e\u0431\u044b stage \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u043f\u043e \u043a\u0440\u043e\u043d\u0443         }         steps {           script {             \/\/ \u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0437 runWerf.groovy             runWerf(&quot;${dockerCreds}&quot;,&quot;build-and-publish&quot;)           }         }       }        stage('Deploy app') {          when {             not { triggeredBy 'TimerTrigger' }           }         environment {           \/\/ \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043a\u0443\u0434\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u043f\u043b\u043e\u0439 (\u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 Helm-\u0447\u0430\u0440\u0442\u0430)           WERF_ENV=&quot;production&quot;         }         steps {           runWerf(&quot;${dockerCreds}&quot;,&quot;deploy --stages-storage :local --images-repo ${imagesRepo}&quot;)         }       }       stage('Cleanup werf Images') {          when {           allOf {             triggeredBy 'TimerTrigger'             branch 'master'            }         }         steps {           sh &quot;echo 'Cleaning up werf images'&quot;             runWerf(&quot;${dockerCreds}&quot;,&quot;cleanup --stages-storage :local --images-repo ${imagesRepo}&quot;)         }       }     }   } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f:<\/p>\n<ul>\n<li> \u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0432\u044b\u043a\u0430\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0432\u0435\u0442\u043a\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <code>discover<\/code> \u0443 Jenkins. \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0448\u0438\u0445 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/li>\n<li> \u0412\u0441\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>werf-secret-key-default<\/code> \u0438 <code>docker-credential-default<\/code>, \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 Jenkins Credentials:\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0u\/jw\/4s\/0ujw4staekxyfnbknu5z9lybdei.png\">  <\/li>\n<\/ul>\n<p>  \u0421\u0430\u043c <code>Jenkinsfile<\/code>, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"plaintext\">@Library('common-ci') _ multiStage ([ namespace: 'yournamespace' ]) <\/code><\/pre>\n<p>  \u0418\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>vars<\/code>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0442\u043e\u043a \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435, \u0433\u0434\u0435 \u0438\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d. \u0418 \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 namespace \u0432 <code>Map<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0430\u043c\u043e \u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"plaintext\">def namespace = &quot;test&quot; def werf_env = &quot;test&quot; if (env.JOB_BASE_NAME == 'master') {  namespace = &quot;stage&quot;  werf_env = &quot;stage&quot; } if (env.TAG_NAME) {  namespace = &quot;production&quot;  werf_env = &quot;production&quot; }  # \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 environment \u0441\u0442\u0430\u0434\u0438\u0438 environment {   WERF_ENV=&quot;${werf_env}&quot;  } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a stage \u0441\u043e \u0432\u0441\u0435\u0445 \u0432\u0435\u0442\u043e\u043a, \u0430 \u0441 \u0442\u0435\u0433\u043e\u0432 \u0432 production \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 Jenkins, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435: <code>currentBuild.rawBuild.getCauses()[0].toString().contains('UserIdCause')<\/code>. \u041e\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u0441\u0431\u043e\u0440\u043a\u0430 \u0431\u044b\u043b\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c \u0438\u043b\u0438 \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u043a\u0430\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442 webhook&#8217;\u0430.<\/p>\n<h2>\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u043f\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u043c \u0438\u0437 Bitbucket<\/h2>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Jenkins \u0441\u0430\u043c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 Bitbucket. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b:<\/p>\n<ul>\n<li> <a href=\"https:\/\/plugins.jenkins.io\/cloudbees-bitbucket-branch-source\">Bitbucket Branch Source Plugin<\/a> \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 Bitbucket \u043a\u0430\u043a source \u0434\u043b\u044f multibranch pipeline;<\/li>\n<li> <a href=\"https:\/\/plugins.jenkins.io\/basic-branch-build-strategies\">Basic Branch Build Strategies Plugin<\/a> \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0433\u043e\u0432 \u043f\u043e webhook. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Jenkins \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0442\u0435\u0433\u0430\u043c\u0438, \u0442.\u043a. \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u0442\u0435\u0433\u043e\u0432 \u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439.<\/li>\n<\/ul>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 cloud-\u0432\u0435\u0440\u0441\u0438\u044e Bitbucket, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 webhook&#8217;\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u043c, \u0442.\u043a. Jenkins \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 API. \u042d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u0430\u043a \u0434\u043b\u044f cloud-\u0432\u0435\u0440\u0441\u0438\u0438, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e Bitbucket-\u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Jenkins:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wg\/ae\/n3\/wgaen3kndbjt8dpteyhjb0c5zkk.png\"><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <code>source<\/code> \u0432 Multibranch Pipeline, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435 credentials bitbucket \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0438\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, Jenkins \u043d\u0430\u0439\u0434\u0435\u0442 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>  \u0412 \u0441\u0430\u043c\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0442\u043e\u043a, \u0442.\u043a. \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0432\u0435\u0442\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u0430 Jenkins \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0434\u043e\u043b\u0433\u043e \u00ab\u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f\u00bb, \u0435\u0441\u043b\u0438 \u043d\u0430\u0447\u043d\u0435\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0432\u0435\u0442\u043a\u0443. \u042d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0442.\u043a. \u0442\u0435\u0433\u0438 \u0442\u043e\u0436\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u0434 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e Java Regular Expressions \u2014 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0433\u0438\u0431\u043a\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435\u0442.<\/p>\n<p>  \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0443\u0442\u044c: \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u0433\u0438 \u043e\u0442 \u0432\u0435\u0442\u043e\u043a, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 <code>Source<\/code> \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u0433\u043e\u0432. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ny\/dk\/lp\/nydklpg6qbjt557whwmcz_nh7e4.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e Jenkins \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u0440\u0432\u0438\u0441-\u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0441\u0430\u043c \u0441\u0445\u043e\u0434\u0438\u0442 \u0432 Bitbucket \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 webhook:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oo\/ok\/_g\/oook_gdhmb18m6pfqvsnu31shs4.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435 Bitbucket \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b (\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445 \u0432\u0435\u0442\u043e\u043a \u0438 \u0442\u0435\u0433\u043e\u0432, \u0447\u0442\u043e \u043c\u044b \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043b\u0438) \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 Bitbucket \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tf\/mw\/8o\/tfmw8oqmkrwzmdp__mti8sg9vze.png\"><br \/>  <i>\u0421\u0442\u0430\u0442\u0443\u0441\u044b \u2014 \u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0435: \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u044e\u0442 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0432 Jenkins<\/i><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0442\u0440\u0438\u0445 \u2014 \u043f\u0440\u043e Jenkins, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 nginx proxy \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e location. \u0422\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e location, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u0430\u043c \u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0435\u0433\u043e endpoint:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bw\/_e\/co\/bw_ecotckzb2slr_nnulzyyl82a.png\"><\/p>\n<p>  \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 pipeline \u0432 Bitbucket \u0431\u0443\u0434\u0443\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 CI \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Jenkins, Bitbucket \u0438 werf. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043d\u0430\u0446\u0435\u0435\u0439 \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0434\u043e\u0439\u0442\u0438 \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0433\u043e CI \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c werf.<\/p>\n<p>  \u0412\u0430\u0436\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c: \u0434\u0430\u0436\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043e\u0442\u0434\u0430\u0435\u0442\u0441\u044f \u0432 Bitbucket, \u043d\u0430\u043c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u00ab\u0445\u043e\u0434\u0438\u0442\u044c\u00bb \u0432 Jenkins, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u0438. \u0412\u044b\u043a\u0430\u0442 \u043f\u043e \u0442\u0435\u0433\u0443 \u0447\u0435\u0440\u0435\u0437 webhook, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437: \u043b\u044e\u0431\u043e\u0439 \u043e\u0442\u043a\u0430\u0442 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0442\u0435\u0433 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u0437 Jenkins.<\/p>\n<p>  \u0423 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043b\u044e\u0441 \u2014 \u044d\u0442\u043e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c. \u041c\u044b \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 CI \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u0425\u043e\u0442\u044f \u0438 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 CI-\u0441\u0438\u0441\u0442\u0435\u043c.<\/p>\n<h2>\u042d\u043f\u0438\u043b\u043e\u0433: \u043f\u0440\u043e werf \u0438 CI\/CD \u0432 \u0446\u0435\u043b\u043e\u043c<\/h2>\n<p>  \u041e\u0431\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 werf \u0441 CI\/CD-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 <a href=\"https:\/\/ru.werf.io\/documentation\/using_with_ci_cd_systems.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0412\u043a\u0440\u0430\u0442\u0446\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0448\u0430\u0433\u0438 \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<ol>\n<li> \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e <code>DOCKER_CONFIG<\/code> \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c\u0438 job&#8217;\u0430\u043c\u0438 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c runner&#8217;\u0435 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/ru.werf.io\/documentation\/reference\/working_with_docker_registries.html#%D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F-docker\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/li>\n<li> \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 Docker \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 Docker Registry. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Docker Registry \u0432\u043d\u0443\u0442\u0440\u0438 CI-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043b\u0438\u0431\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u043c\u0438 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <a href=\"https:\/\/docs.gitlab.com\/ee\/user\/packages\/container_registry\/\">GitLab Container Registry<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/github.com\/features\/packages\">GitHub Docker Package<\/a>) \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u0440\u0435\u0434\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 registry \u043c\u043e\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c runner&#8217;\u0435 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0445 (\u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e job&#8217;\u0430).<\/li>\n<li> \u041f\u0440\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 <code>WERF_IMAGES_REPO<\/code>, <code>WERF_STAGES_STORAGE<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 <a href=\"https:\/\/ru.werf.io\/documentation\/reference\/working_with_docker_registries.html\">\u0432\u0430\u0440\u044c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0423\u0442\u0438\u043b\u0438\u0442\u0430 werf \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u043d\u0430\u0442\u044c, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e API. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e werf \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0441 \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u0430 registry, \u043d\u043e \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0447\u0430\u0441\u0442\u043e \u043d\u0435\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u0430 (\u0438 \u0442\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438).<\/li>\n<li> \u041f\u0440\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u043f\u0446\u0438\u0439 \u0442\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <code>WERF_TAG_*<\/code>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f CI, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0447\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u0435\u043a\u0443\u0449\u0438\u0439 job, \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043e\u043f\u0446\u0438\u044e \u0442\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c content-based \u0442\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c).<\/li>\n<li> \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f CI-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u043a\u0430\u0442\u0435. \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u2014 <a href=\"https:\/\/docs.gitlab.com\/ee\/ci\/environments\/\">environment \u0432 GitLab<\/a>.<\/li>\n<li> \u041f\u0440\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 <code>WERF_ADD_ANNOTATION_*<\/code>. \u0421\u0440\u0435\u0434\u0438 \u044d\u0442\u0438\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Kubernetes. \u041c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440:<br \/> \n<ol>\n<li> <code>WERF_ADD_ANNOTATION_PROJECT_GIT<\/code> \u2014 \u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 Git;<\/li>\n<li> <code>WERF_ADD_ANNOTATION_CI_COMMIT<\/code> \u2014 \u043a\u043e\u043c\u043c\u0438\u0442, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u043a\u0430\u0442\u0443;<\/li>\n<li> <code>WERF_ADD_ANNOTATION_JOB<\/code> \u0438\u043b\u0438 <code>WERF_ADD_ANNOTATION_PIPELINE<\/code> \u2014 \u0430\u0434\u0440\u0435\u0441 job \u0438\u043b\u0438 pipeline (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 CI-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u044f), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0432\u044b\u043a\u0430\u0442\u043e\u043c.<\/li>\n<\/ol>\n<\/li>\n<li> \u041f\u0440\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u0433\u043e\u043c werf:<br \/> \n<ol>\n<li> <code>WERF_LOG_COLOR_MODE=on<\/code> \u2014 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 (werf \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0446\u0432\u0435\u0442\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b);<\/li>\n<li> <code>WERF_LOG_PROJECT_DIR=1<\/code> \u2014 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430;<\/li>\n<li> <code>WERF_LOG_TERMINAL_WIDTH=95<\/code> \u2014 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0448\u0438\u0440\u0438\u043d\u044b \u0432\u044b\u0432\u043e\u0434\u0430 (werf \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0448\u0438\u0440\u0438\u043d\u0430 \u0440\u0430\u0432\u043d\u0430 140).<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>  \u0417\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f werf \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0440\u0435\u0448\u0430\u0435\u0442 \u043e\u0431\u0449\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0449\u0435 \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0448\u0430\u0433\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044d\u0442\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>werf ci-env<\/code> \u0434\u043b\u044f <a href=\"https:\/\/ru.werf.io\/documentation\/advanced\/ci_cd\/gitlab_ci_cd.html\">GitLab CI\/CD<\/a> \u0438 <a href=\"https:\/\/ru.werf.io\/documentation\/advanced\/ci_cd\/github_actions.html\">GitHub Actions<\/a>. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0434\u0440\u0443\u0433\u0438\u0445 CI-\u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u2014 \u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 Jenkins.<\/p>\n<h2>P.S.<\/h2>\n<p>  \u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/332712\/\">GitLab CI \u0434\u043b\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 production. \u0427\u0430\u0441\u0442\u044c 1: \u043d\u0430\u0448 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/504390\/\">\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e CI\/CD \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e werf<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/526702\/\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 GitLab Runner \u0441 werf \u2014 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 SonarQube<\/a>\u00bb.<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/529750\/\"> https:\/\/habr.com\/ru\/company\/flant\/blog\/529750\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fy\/s1\/i_\/fys1i_7drlxrjlxl2skt4fkzv4q.png\"><\/p>\n<p>  \u0423\u0442\u0438\u043b\u0438\u0442\u0430 <a href=\"https:\/\/ru.werf.io\/\">werf<\/a> \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0435\u0451 \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 CI\/CD-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 <i>\u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435<\/i> \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u0432 \u044d\u043f\u0438\u043b\u043e\u0433\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u2014 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 CI \u0432 Jenkins \u0438 Bitbucket.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ol>\n<li> Shared Library \u0434\u043b\u044f Jenkins, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 CI \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0434\u0438\u043d\u044b\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c.<\/li>\n<li> \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e Jenkins \u0441 Bitbucket, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c CI \u043f\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0443 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0442\u043a\u0438 \u0438\u043b\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0435\u0433\u0430.<\/li>\n<\/ol>\n<p>  \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-315086","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=315086"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315086\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}