{"id":363701,"date":"2024-05-21T02:01:37","date_gmt":"2024-05-21T02:01:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=363701"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T02:01:37","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=363701","title":{"rendered":"<span>Jenkins Pipeline \u0434\u043b\u044f \u0410\u0422<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/279\/8ff\/a83\/2798ffa83df3c3fd0e59619c0db1f373.jpg\" width=\"1500\" height=\"845\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/279\/8ff\/a83\/2798ffa83df3c3fd0e59619c0db1f373.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c pipeline.jenkinsfile \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0430\u043c\u043e\u0433\u043e Jenkins \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0442\u043e\u043b\u044c\u043a\u043e pipeline \u0438 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0410\u0422.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>java<\/p>\n<\/li>\n<li>\n<p>maven<\/p>\n<\/li>\n<li>\n<p>junit5<\/p>\n<\/li>\n<li>\n<p>allure<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043d\u0443\u0441\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0432 <a href=\"#gitlab\">GitLab.<\/a><\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442 Jenkins?<\/h2>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e (\u043d\u043e\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044b \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 pipeline \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0441redentials<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0433\u0438\u00a0<\/p>\n<ul>\n<li>\n<p>\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 (Test Suite)<\/p>\n<\/li>\n<li>\n<p>\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 allure-\u043e\u0442\u0447\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>pipeline.jenkinsfile<\/h2>\n<p>\u0418 \u0442\u0430\u043a, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0440\u0430\u0437\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"java\">pipeline {     agent {         node {             label 'jenkins-vm.company.ru'         }     }     triggers {             cron('H 7 * * *')     }     parameters{         choice(choices: ['regress', 'smoke'], description: '\u0412\u044b\u0431\u043e\u0440 \u0441\u044c\u044e\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430', name: 'suiteToRun')     }     environment{         mailRecipients = 'dminakova@cinimex.ru'         TEST_CREDS = credentials('444444444')     }     stages {         stage('clone repo') {             steps{                 checkout([$class                           : 'GitSCM', branches: [[name: '*\/master']],                           doGenerateSubmoduleConfigurations: false,                           extensions                       : [],                           submoduleCfg                     : [],                           userRemoteConfigs                : [[credentialsId: '22222222',                                                                url          :  'https:\/\/git.company.ru\/java_example.git']]                           ])             }         }         stage('run tests') {             steps{                 catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {                     withMaven(jdk: 'JDK 8u172', maven: 'Maven 3.6.3') {                         sh 'mvn clean install -Dgroups=${suiteToRun}'                     }                 }             }         }         stage('run allure reports') {             steps {                 allure([includeProperties: true,                                       jdk: '',                                properties: [],                         reportBuildPolicy: 'ALWAYS',                                   results: [[path: '**\/allure-results']]                 ])             }         }     }     post {         always{             echo 'Pipeline is complete'             emailext (             subject: \"CMXQA.TESTS \u041e\u0442\u0447\u0435\u0442 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 [${env.BUILD_NUMBER}] \",             body:\"\"\"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 allure-\u043e\u0442\u0447\u0435\u0442: \"&lt;a href='${env.BUILD_URL}allure\/'>${env.JOB_NAME} [${env.BUILD_NUMBER}]&lt;\/a>\"&lt;\/p>\"\"\",             to: \"${env.mailRecipients}\"             )         }     } }<\/code><\/pre>\n<blockquote>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/DaryaMin\/jenkins_pipeline_at\/tree\/master\">https:\/\/github.com\/DaryaMin\/jenkins_pipeline_at\/tree\/master<\/a>  <\/p>\n<\/blockquote>\n<hr\/>\n<h2>Pipeline \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u00a0pipeline \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e.  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u0438:<\/p>\n<p><a class=\"anchor\" name=\"content\" id=\"content\"><\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#environment\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#parametrs\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#credentials\">Credentials<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#triggers\">\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0441\u0431\u043e\u0440\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#stages\">\u042d\u0442\u0430\u043f\u044b\/stages<\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#git\">\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#run\">\u0437\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#allure\">\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#post\">\u041d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#scm\">Pipeline from SCM<\/a><\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<p><a class=\"anchor\" name=\"environment\" id=\"environment\"><\/a><\/p>\n<h3>1. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/h3>\n<p>Pipeline \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 \u043d\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <strong>environment.\u00a0<\/strong>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043a\u043b\u044e\u0447 = &#8216;\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&#8217;.<\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 ${env.&lt;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439>}, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: ${env.mailRecipients}<\/p>\n<pre><code class=\"java\">environment { \u00a0 \u00a0 \u00a0 \u00a0 allureResults = 'target\/allure-results', \u00a0 \u00a0 \u00a0 \u00a0 allureReportPolicy = 'ALWAYS', \u00a0 \u00a0 \u00a0 \u00a0 mailRecipients = 'test@cinimex.ru,\u00a0dminakova@cinimex.ru' \u00a0 \u00a0 }<\/code><\/pre>\n<p> <a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"parametrs\" id=\"parametrs\"><\/a><\/p>\n<h3>2. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<p>\u0412 Pipeline \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0443. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: url \u0441\u0442\u0435\u043d\u0434\u0430, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u044c\u044e\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0442.\u043f.<\/p>\n<p>\u041a\u043e\u0434\u043e\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e &#8212; <strong>parameters<\/strong>.<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.\u00a0<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>string<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>parameters { string(name: 'DEPLOY_ENV', defaultValue: 'staging', description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>text<br \/>\u041c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>parameters { text(name: 'DEPLOY_TEXT', defaultValue: 'One\\nTwo\\nThree\\n', description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>booleanParam<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u0438\u043d\u0430\/\u043b\u043e\u0436\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>parameters { booleanParam(name: 'DEBUG_BUILD', defaultValue: true, description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>choice<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0436\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u0432\u044b\u0431\u043e\u0440\u0443. \u0427\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u044c\u044e\u0442\u0430 (\u0440\u0435\u0433\u0440\u0435\u0441\u0441, \u0441\u043c\u043e\u043a, \u0434\u0435\u0431\u0430\u0433), \u0442.\u043a. \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u044c\u044e\u0442\u043e\u0432 \u0440\u0435\u0434\u043a\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f.<br \/><code>parameters { choice(name: 'CHOICES', choices: ['one', 'two', 'three'], description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>password<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u044f.<br \/><code>parameters { password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'A secret password')\u00a0<\/code><\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>gitParameter<\/strong>. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Jenkins \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c Git Parametr. <code>parameters { gitParameter(name: 'BRANCH', defaultValue: 'develop', description: '\u0412\u0435\u0442\u043a\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0435\u043f\u043b\u043e\u0438\u043c\u0441\u044f', branchFilter: 'origin\/(.*)', type: 'PT_BRANCH', selectedValue: 'DEFAULT')}<\/code><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">pipeline {     agent any     parameters {         string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')          text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')          booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')          choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')          password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')     }     stages {         stage('Example') {             steps {                 echo \"Hello ${params.PERSON}\"                  echo \"Biography: ${params.BIOGRAPHY}\"                  echo \"Toggle: ${params.TOGGLE}\"                  echo \"Choice: ${params.CHOICE}\"                  echo \"Password: ${params.PASSWORD}\"             }         }     } }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/11b\/8c3\/cfd\/11b8c3cfd4f23956704b7b68920df3d8.png\" alt=\"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0431\u043e\u0440\u043a\u0438\" title=\"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0431\u043e\u0440\u043a\u0438\" width=\"1919\" height=\"716\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/11b\/8c3\/cfd\/11b8c3cfd4f23956704b7b68920df3d8.png\"\/><\/p>\n<div><figcaption>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0431\u043e\u0440\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/431\/a8c\/285\/431a8c2856331177a7c55797d9fd8353.jpg\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c jenkins\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c jenkins\" width=\"1038\" height=\"765\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/431\/a8c\/285\/431a8c2856331177a7c55797d9fd8353.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c jenkins<\/figcaption><\/div>\n<\/figure>\n<\/div>\n<\/details>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"credentials\" id=\"credentials\"><\/a><\/p>\n<hr\/>\n<h3>3. Credentials<\/h3>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/beb\/872\/536\/beb87253674f0126d2319f1a23b9df46.png\" width=\"1037\" height=\"766\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/beb\/872\/536\/beb87253674f0126d2319f1a23b9df46.png\"\/><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Jenkins \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 echo \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f\u00a0Groovy String interpolation \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c.\u00a0<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435?!<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f91\/f9a\/093\/f91f9a093542b25e6680079c164b9c59.png\" width=\"339\" height=\"208\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f91\/f9a\/093\/f91f9a093542b25e6680079c164b9c59.png\"\/><\/figure>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <strong>\u0434\u0432\u043e\u0439\u043d\u044b\u0435<\/strong> \u043a\u0430\u0432\u044b\u0447\u043a\u0438 <strong>\u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435<\/strong>.<br \/>\u041e \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c\u00a0credentials(). <\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/b07\/ecf\/75a\/b07ecf75afe8df3b9fb6e01832b71cad.jpg\" width=\"964\" height=\"736\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b07\/ecf\/75a\/b07ecf75afe8df3b9fb6e01832b71cad.jpg\" data-blurred=\"true\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u0435\u0442\u043e\u0434 <strong>credentials()<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>secret text<\/p>\n<\/li>\n<li>\n<p>usernames and passwords<\/p>\n<\/li>\n<li>\n<p>secret files<\/p>\n<\/li>\n<li>\n<p>Jenkins&#8217;\u00a0Snippet Generator\u00a0\u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 credential \u0432 Jenkins<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b credentials<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/682\/925\/c5c\/682925c5c89441f4ad3c5410c92361a3.jpg\" width=\"249\" height=\"612\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/682\/925\/c5c\/682925c5c89441f4ad3c5410c92361a3.jpg\" data-blurred=\"true\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0430\u043f\u043a\u0443<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0cc\/3c0\/cb9\/0cc3c0cb9282c6592e8d7ac44e95a482.png\" width=\"321\" height=\"175\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0cc\/3c0\/cb9\/0cc3c0cb9282c6592e8d7ac44e95a482.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u043e\u043c\u0435\u043d<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb4\/be8\/b36\/cb4be8b3656219cdfa6a61e82d433f28.png\" width=\"1914\" height=\"745\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb4\/be8\/b36\/cb4be8b3656219cdfa6a61e82d433f28.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 credentials. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043c\u0435\u043d\u044e: Add credentials<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/ee0\/29b\/38c\/ee029b38cfd77a50139bea5c26b6926b.jpg\" width=\"1903\" height=\"435\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee0\/29b\/38c\/ee029b38cfd77a50139bea5c26b6926b.jpg\" data-blurred=\"true\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0442\u0438\u043f Username and Password. \u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Jenkins \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 Vault.\u00a0 \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439\u00a0<a href=\"https:\/\/plugins.jenkins.io\/hashicorp-vault-plugin\/\">https:\/\/plugins.jenkins.io\/hashicorp-vault-plugin\/<\/a><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/057\/5b3\/16b\/0575b316b6dbc32d6b7f75263a74d44a.png\" width=\"1916\" height=\"647\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/057\/5b3\/16b\/0575b316b6dbc32d6b7f75263a74d44a.png\"\/><\/figure>\n<p>\u0427\u0435\u043a-\u0431\u043e\u043a\u0441\u00a0Treat username as secret \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 username \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0435 credentials<br \/>ID \u0435\u0441\u043b\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d9e\/aae\/b59\/d9eaaeb59a92732c0609139938fecbe7.jpg\" width=\"1903\" height=\"435\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d9e\/aae\/b59\/d9eaaeb59a92732c0609139938fecbe7.jpg\" data-blurred=\"true\"\/><\/figure>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b credentials \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:<\/p>\n<pre><code class=\"java\">environment {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0TEST_CREDS = credentials('4444444444444')  \u00a0\u00a0\u00a0\u00a0}<\/code><\/pre>\n<p>\u0437\u0434\u0435\u0441\u044c TEST_CREDS &#8212; \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0430 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u0430\u043d ID credentials<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 user:password. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e user \u0438\u043b\u0438 password \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f _USR \u0438\u043b\u0438 _PSW \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u0430$ \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d credentials \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"java\">pipeline {     agent {         node {             label 'jenkins-vm.company.ru'         }     }       parameters {         string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')           text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')           booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')           choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')           password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')     }     environment {         TEST_CREDS = credentials('4444444444')     }     stages {         stage('Example') {             steps {                 echo \"Hello ${params.PERSON}\"                   echo \"Biography: ${params.BIOGRAPHY}\"                   echo \"Toggle: ${params.TOGGLE}\"                   echo \"Choice: ${params.CHOICE}\"                   echo 'Password: ${params.PASSWORD}'                                   echo 'from credentials: $TEST_CREDS'                                   echo \"user from credentials: $TEST_CREDS_USR\"                                   echo \"password from credentials: $TEST_CREDS_PSW\"             }         }     } }<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/994\/5e6\/55e\/9945e655ed30bf549531b71dbc75351c.png\" width=\"1037\" height=\"841\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/994\/5e6\/55e\/9945e655ed30bf549531b71dbc75351c.png\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u043e\u0439\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u041d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439, \u043e \u0447\u0435\u043c \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 Jenkins. \u0418 <strong>\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438<\/strong>.<\/p>\n<\/div>\n<\/details>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"triggers\" id=\"triggers\"><\/a><\/p>\n<hr\/>\n<h3>4. \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0441\u0431\u043e\u0440\u043a\u0438<\/h3>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/82d\/a1f\/fc3\/82da1ffc3bfdf6278719698106e24a1e.png\" width=\"851\" height=\"427\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/82d\/a1f\/fc3\/82da1ffc3bfdf6278719698106e24a1e.png\"\/><\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438:<br \/>    &#8212; \u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u043a\u0438\u00a0<br \/>    &#8212; \u0421\u0442\u0430\u0440\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<br \/>    &#8212; \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 <br \/>    &#8212; \u041f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 GitLab<br \/>    &#8212; \u0422\u0440\u0438\u0433\u0433\u0435\u0440 \u0438\u0437 \u0430\u0440\u0442\u0438\u0444\u0430\u043a\u0442\u043e\u0440\u0438<br \/>    &#8212; \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b GitHub<br \/>    &#8212; Scm \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u00a0<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 &#8212; \u044d\u0442\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u0432 7 \u0443\u0442\u0440\u0430. \u0427\u0442\u043e\u0431\u044b \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u043d\u044f \u0431\u044b\u043b\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440, \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0434\u043d\u0438 \u0432 7.00: <strong>H 7 * * 1-5<\/strong>\u00a0<\/p>\n<p><a class=\"anchor\" name=\"gitlab\" id=\"gitlab\"><\/a><\/p>\n<h4>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441 GitLab<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bc9\/f97\/acc\/bc9f97acc33b7edf57d57a29ff08e666.png\" width=\"1150\" height=\"469\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bc9\/f97\/acc\/bc9f97acc33b7edf57d57a29ff08e666.png\"\/><\/figure>\n<p>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0432\u0443\u0447\u0438\u0442 &#171;Build when a change is pushed to GitLab. GitLab webhook URL:\u00a0https:\/\/company.jenkins.ru\/project\/TEST\/ExampleMVN&#187;\u00a0<br \/>\u0418\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f URL. \u0418\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0430\u0434\u0440\u0435\u0441 GitLab \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p>\u041f\u043e \u043a\u0430\u043a\u0438\u043c \u0436\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c Jenkins \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443?<\/p>\n<ol>\n<li>\n<p>\u043b\u044e\u0431\u043e\u0439 Push \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>Push \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0432\u0435\u0442\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0433\u043e\u00a0Merge Request<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Merge Request \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u043d\u043e\u0432\u044b\u0435\u00a0 \u043a\u043e\u043c\u043c\u0438\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u00a0Merge Request<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435 Merge Request<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 Merge Request<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 Merge Request \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442 <\/p>\n<\/li>\n<\/ol>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c,\u00a0 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b <strong>Gitlab.<\/strong>  <\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/294\/d70\/ea6\/294d70ea6cb14b5e52c8e61de8af0059.png\" alt=\"\u0412 \u043c\u0435\u043d\u044e &quot;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438&quot; \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442 &quot;Webhooks&quot;\" title=\"\u0412 \u043c\u0435\u043d\u044e &quot;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438&quot; \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442 &quot;Webhooks&quot;\" width=\"191\" height=\"311\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/294\/d70\/ea6\/294d70ea6cb14b5e52c8e61de8af0059.png\"\/><\/p>\n<div><figcaption>\u0412 \u043c\u0435\u043d\u044e &#171;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438&#187; \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442 &#171;Webhooks&#187;<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cab\/fc0\/c60\/cabfc0c60e5564add09568dbc57fb441.png\" width=\"810\" height=\"261\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cab\/fc0\/c60\/cabfc0c60e5564add09568dbc57fb441.png\"\/><\/figure>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f URL \u0438 Secret Token.<br \/><strong>URL<\/strong>\u00a0&#8212; \u0443\u043a\u0430\u0437\u0430\u043d \u0432 Jenkins \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438 \u0447\u0435\u043a-\u0431\u043e\u043a\u0441 \u043f\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0443 \u0441\u0431\u043e\u0440\u043a\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e\u00a0https:\/\/company.jenkins.ru\/project\/TEST\/ExampleMVN<\/p>\n<p><strong>Secret Token\u00a0<\/strong>\u00a0&#8212; \u0442\u0430\u043a\u0436\u0435 \u0431\u0435\u0440\u0435\u043c \u0438\u0437 Jenkins \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 Gitlab. \u0422\u043e\u0447\u043d\u0435\u0435, \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u0432 Gitlab \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432 Jenkins.<\/p>\n<p><strong>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f Secret Token\u00a0<\/strong><\/p>\n<ol>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7d8\/db8\/963\/7d8db8963cade66e603a8bc0bba2f34a.png\" width=\"1161\" height=\"476\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d8\/db8\/963\/7d8db8963cade66e603a8bc0bba2f34a.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u00a0\u041d\u0430\u0436\u0430\u0442\u044c Generate\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8f7\/9ef\/461\/8f79ef46181aa033259ee56e0229af4f.png\" width=\"1080\" height=\"837\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f7\/9ef\/461\/8f79ef46181aa033259ee56e0229af4f.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 GitLab  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/679\/01f\/db1\/67901fdb1692e0ace8b9f44542ea94ed.png\" width=\"1082\" height=\"145\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/679\/01f\/db1\/67901fdb1692e0ace8b9f44542ea94ed.png\"\/><\/figure>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f webhook \u043e\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0432\u043d\u0438\u0437\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4cf\/397\/82c\/4cf39782ccd5eb1ff2082f0367d93c9b.png\" width=\"529\" height=\"165\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4cf\/397\/82c\/4cf39782ccd5eb1ff2082f0367d93c9b.png\"\/><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Test.\u00a0\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0442\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u00a0  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b19\/a34\/f03\/b19a34f03dbb35d9225c52c2daa52116.png\" width=\"777\" height=\"42\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b19\/a34\/f03\/b19a34f03dbb35d9225c52c2daa52116.png\"\/><\/figure>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"stages\" id=\"stages\"><\/a><\/p>\n<hr\/>\n<h2>5. \u042d\u0442\u0430\u043f\u044b\/stages\u00a0<\/h2>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438c\u0445\u043e\u0434\u0438\u0442 \u0432 Pipeline \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 \u0431\u043b\u043e\u043a\u0435 Stages. \u0411\u043b\u043e\u043a Stages \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u044d\u0442\u0430\u043f (stage).\u00a0 \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0430\u043f\u044b \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:\u00a0Build, Test, and Deploy.<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u0442\u0430\u043f (stage) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442:<\/p>\n<ol>\n<li>\n<p>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0440\u0443\u0433\u043b\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0432 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0448\u0430\u0433\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (steps)<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">stages {     stage('Example') {         steps {             echo 'Hello World'         }     } }<\/code><\/pre>\n<p><a class=\"anchor\" name=\"git\" id=\"git\"><\/a><\/p>\n<h3>5. 1 \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h3>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438 \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.\u00a0https:\/\/www.jenkins.io\/doc\/pipeline\/steps\/git\/<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d Jenkins\u00a0<a href=\"https:\/\/plugins.jenkins.io\/git\/\">https:\/\/plugins.jenkins.io\/git\/<\/a><\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>git step<\/p>\n<\/li>\n<li>\n<p>checkout step<\/p>\n<\/li>\n<\/ul>\n<p>git step \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u043d\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c.<br \/>checkout step \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 SCM checkout method.\u00a0<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 git step. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e\u00a0SCM checkout method \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\u00a0<a href=\"https:\/\/plugins.jenkins.io\/git\/#plugin-content-pipeline-examples\">https:\/\/plugins.jenkins.io\/git\/#plugin-content-pipeline-examples<\/a><\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 Pipeline, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u043b\u043e\u043d\u0438\u0440\u0443\u044e\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">pipeline {     agent {         node {             label 'jenkins-vm.company.ru'         }     }     stages {         stage('clone repo') {             steps {                 git url: 'https:\/\/git.company.ru\/java_example.git',                 credentialsId: '22222222',                 branch: 'master'             }         }     } }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2f1\/a19\/430\/2f1a1943084d72c8194cec6c4e358483.jpg\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Pipeline\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Pipeline\" width=\"1291\" height=\"851\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f1\/a19\/430\/2f1a1943084d72c8194cec6c4e358483.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Pipeline<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 c checkout:<\/p>\n<pre><code class=\"java\">Stage('clone repo') {     steps{         checkout([$class : 'GitSCM', branches: [[name: '*\/master']],         doGenerateSubmoduleConfigurations: false,         extensions                       : [],         submoduleCfg                     : [],         userRemoteConfigs                : [[credentialsId: '2222222222',         url          :  'https:\/\/git.company.ru\/java_example.git']]]                 )             }         }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"run\" id=\"run\"><\/a><\/p>\n<h3>5.2 \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c. <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 mvn (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435) mvn clean install. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e jdk, maven. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u0439 \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443 \u0441\u0435\u0431\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 (Test Suite).<\/p>\n<pre><code class=\"java\">stage('run tests') {      steps{           withMaven(jdk: 'JDK 8u172', maven: 'Maven 3.6.3') {                              sh 'mvn clean install'            }      }  }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0417\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u044c\u044e\u0442\u0430 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f Tag. <\/p>\n<\/li>\n<\/ol>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b1\/4dd\/24a\/8b14dd24ac711ad19183db33b2bac6b4.png\" width=\"377\" height=\"286\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b1\/4dd\/24a\/8b14dd24ac711ad19183db33b2bac6b4.png\"\/><\/figure>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f SMOKE \u0438 REGRESS \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b. \u0418 \u0443\u0436\u0435 \u043d\u0430 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f Pipeline<\/p>\n<pre><code class=\"java\">public class SuiteName {     public static final String SMOKE = \"smoke\";     public static final String REGRESS= \"regress\"; }<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0412 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440:  <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">parameters{choice(choices: ['regress', 'smoke',],                   description: '\u0412\u044b\u0431\u043e\u0440 \u0441\u044c\u044e\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430',                   name: 'suiteToRun')}<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5f1\/555\/e72\/5f1555e727b0f6f34e5e727ed4e1c9ff.png\" width=\"1055\" height=\"325\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5f1\/555\/e72\/5f1555e727b0f6f34e5e727ed4e1c9ff.png\"\/><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:  <\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">sh 'mvn clean install -Dgroups=${suiteToRun}'<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p><a class=\"anchor\" name=\"allure\" id=\"allure\"><\/a><\/p>\n<h3><\/h3>\n<\/p>\n<\/div>\n<\/details>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<h3>5.3 \u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430\u043c \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432. <\/p>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/57d\/a96\/86c\/57da9686c302f3e891872946d5434d6e.png\" width=\"890\" height=\"527\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/57d\/a96\/86c\/57da9686c302f3e891872946d5434d6e.png\"\/><\/figure>\n<p>Jenkins \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0447\u0435\u0442 \u043e\u0431 \u0443\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0438\u0434\u043d\u043e: <br \/>&#8212; \u041a\u0435\u043c \u0431\u044b\u043b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d \u0437\u0430\u043f\u0443\u0441\u043a<br \/>&#8212; \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c<br \/>&#8212; \u0412 \u043a\u0430\u043a\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043b\u0435\u0436\u0430\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<br \/> &#8212; \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0443\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0443\u0434\u043e\u0431\u0435\u043d \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432.\u00a0\u0411\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0448\u0430\u0433\u043e\u0432 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c <strong>allure report<\/strong>.\u00a0 Jenkins \u0443\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0441 \u043d\u0438\u043c  \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u00a0\u00a0<a href=\"https:\/\/www.jenkins.io\/doc\/pipeline\/steps\/allure-jenkins-plugin\/\">https:\/\/www.jenkins.io\/doc\/pipeline\/steps\/allure-jenkins-plugin\/<\/a>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b Allure \u043e\u0442\u0447\u0435\u0442 \u0431\u044b\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u0435\u043d \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c Allure.\u00a0\u00a0<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e Allure: \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f:\u00a0<a href=\"https:\/\/docs.qameta.io\/allure\/#_junit_5\">https:\/\/docs.qameta.io\/allure\/#_junit_5<\/a><\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b jenkins \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b allure-\u043e\u0442\u0447\u0435\u0442, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 pipline \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u0430\u043f:  <\/p>\n<pre><code class=\"java\"> stage('run allure reports') {             steps {                 allure([includeProperties: true,                                       jdk: '',                                properties: [],                         reportBuildPolicy: 'ALWAYS',                                   results: [[path: '**\/allure-results']]                 ])             }         }<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0438 \u0437\u043d\u0430\u0447\u043e\u043a allure \u0443 \u0441\u0431\u043e\u0440\u043a\u0438, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 allure \u043e\u0442\u0447\u0435\u0442<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ade\/9ba\/44c\/ade9ba44c271a14c8dee40d28fb18d19.png\" width=\"1294\" height=\"942\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ade\/9ba\/44c\/ade9ba44c271a14c8dee40d28fb18d19.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/449\/e97\/0b9\/449e970b9cdaaff4a6fa29ad43bcb9e2.png\" width=\"1916\" height=\"707\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/449\/e97\/0b9\/449e970b9cdaaff4a6fa29ad43bcb9e2.png\"\/><\/figure>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"post\" id=\"post\"><\/a><\/p>\n<hr\/>\n<h3>6. \u041d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/h3>\n<p>Post \u0431\u043b\u043e\u043a \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e stage \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 stage, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 pipeline.<\/p>\n<p>\u0411\u043b\u043e\u043a post \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p><code>always<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>changed<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>fixed<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>regression<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>aborted<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>failure<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>success<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>unstable<\/code>,\u00a0<\/p>\n<\/li>\n<li>\n<p><code>unsuccessful<\/code>,\u00a0<code>cleanup<\/code>.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\u00a0<a href=\"https:\/\/www.jenkins.io\/doc\/book\/pipeline\/syntax\/#post\">https:\/\/www.jenkins.io\/doc\/book\/pipeline\/syntax\/#post<\/a><\/p>\n<p>\u041c\u044b \u043f\u0440\u043e\u0433\u043d\u0430\u043b\u0438 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043e\u0442\u0447\u0435\u0442, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c.\u00a0<br \/>\u041d\u0430\u0448\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u043c \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043b\u0438\u0446\u0430\u043c.<br \/>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0442\u0443\u0442 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435:<\/p>\n<ul>\n<li>\n<p>\u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043d\u0435 \u0432 \u0431\u043b\u043e\u043a\u0435 Post)<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0447\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c)<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u0430\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.\u00a0 \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u043e\u0447\u0442\u0435.<\/p>\n<h4>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0438\u0441\u044c\u043c\u0430 \u043d\u0430 \u043f\u043e\u0447\u0442\u0443<\/h4>\n<p>\u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430 \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u00a0emailext(). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\u00a0<a href=\"https:\/\/plugins.jenkins.io\/email-ext\/\">https:\/\/plugins.jenkins.io\/email-ext\/<\/a><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 pipeline \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u0430\u0432:<\/p>\n<ul>\n<li>\n<p>\u0442\u0435\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043b\u043e (\u0432 \u0442\u0435\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0440\u0430\u0437\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 allure \u043e\u0442\u0447\u0435\u0442)<\/p>\n<\/li>\n<li>\n<p>\u0430\u0434\u0440\u0435\u0441\u0430\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"java\">post {     always{         echo 'Pipeline is complete'         emailext (             subject: \"CMXQA.TESTS \u041e\u0442\u0447\u0435\u0442 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 [${env.BUILD_NUMBER}] \",             body:\"\"\"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 allure-\u043e\u0442\u0447\u0435\u0442: \"&lt;a href='${env.BUILD_URL}allure\/'>${env.JOB_NAME} [${env.BUILD_NUMBER}]&lt;\/a>\"&lt;\/p>\"\"\",             to: \"dminakova@cinimex.ru\"         )     } }<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c44\/c86\/260\/c44c86260fa37a48241edbed39e337e2.png\" width=\"394\" height=\"161\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c44\/c86\/260\/c44c86260fa37a48241edbed39e337e2.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"scm\" id=\"scm\"><\/a><\/p>\n<hr\/>\n<h2>Pipeline from SCM<\/h2>\n<p>\u041d\u0443 \u0438 \u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c: bestPractice \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 jenkins.pipeline \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c<\/strong>  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/702\/483\/509\/70248350951a2148040a40c7cc1c3b15.png\" width=\"1222\" height=\"728\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/702\/483\/509\/70248350951a2148040a40c7cc1c3b15.png\"\/><\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/407\/345\/e7e\/407345e7e77af24627295389a03a6989.png\" width=\"234\" height=\"86\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/407\/345\/e7e\/407345e7e77af24627295389a03a6989.png\"\/><\/figure>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e piplene.jenkinsfile. \u0418 \u044d\u0442\u043e \u0436\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 Script Path.<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0442\u043e \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0432 jenkins<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/782486\/\"> https:\/\/habr.com\/ru\/articles\/782486\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c pipeline.jenkinsfile \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0430\u043c\u043e\u0433\u043e Jenkins \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0442\u043e\u043b\u044c\u043a\u043e pipeline \u0438 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0410\u0422.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>java<\/p>\n<\/li>\n<li>\n<p>maven<\/p>\n<\/li>\n<li>\n<p>junit5<\/p>\n<\/li>\n<li>\n<p>allure<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043d\u0443\u0441\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0432 <a href=\"#gitlab\">GitLab.<\/a><\/p>\n<h2>\u0427\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442 Jenkins?<\/h2>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e (\u043d\u043e\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u043e\u043d\u044b \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 pipeline \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0441redentials<\/p>\n<\/li>\n<li>\n<p>\u0428\u0430\u0433\u0438\u00a0<\/p>\n<ul>\n<li>\n<p>\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 (Test Suite)<\/p>\n<\/li>\n<li>\n<p>\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 allure-\u043e\u0442\u0447\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u0430<\/p>\n<\/li>\n<\/ul>\n<h2>pipeline.jenkinsfile<\/h2>\n<p>\u0418 \u0442\u0430\u043a, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0440\u0430\u0437\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e.<\/p>\n<pre><code class=\"java\">pipeline {     agent {         node {             label 'jenkins-vm.company.ru'         }     }     triggers {             cron('H 7 * * *')     }     parameters{         choice(choices: ['regress', 'smoke'], description: '\u0412\u044b\u0431\u043e\u0440 \u0441\u044c\u044e\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430', name: 'suiteToRun')     }     environment{         mailRecipients = 'dminakova@cinimex.ru'         TEST_CREDS = credentials('444444444')     }     stages {         stage('clone repo') {             steps{                 checkout([$class                           : 'GitSCM', branches: [[name: '*\/master']],                           doGenerateSubmoduleConfigurations: false,                           extensions                       : [],                           submoduleCfg                     : [],                           userRemoteConfigs                : [[credentialsId: '22222222',                                                                url          :  'https:\/\/git.company.ru\/java_example.git']]                           ])             }         }         stage('run tests') {             steps{                 catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {                     withMaven(jdk: 'JDK 8u172', maven: 'Maven 3.6.3') {                         sh 'mvn clean install -Dgroups=${suiteToRun}'                     }                 }             }         }         stage('run allure reports') {             steps {                 allure([includeProperties: true,                                       jdk: '',                                properties: [],                         reportBuildPolicy: 'ALWAYS',                                   results: [[path: '**\/allure-results']]                 ])             }         }     }     post {         always{             echo 'Pipeline is complete'             emailext (             subject: \"CMXQA.TESTS \u041e\u0442\u0447\u0435\u0442 \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 [${env.BUILD_NUMBER}] \",             body:\"\"\"\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 allure-\u043e\u0442\u0447\u0435\u0442: \"&lt;a href='${env.BUILD_URL}allure\/'>${env.JOB_NAME} [${env.BUILD_NUMBER}]&lt;\/a>\"&lt;\/p>\"\"\",             to: \"${env.mailRecipients}\"             )         }     } }<\/code><\/pre>\n<blockquote>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/DaryaMin\/jenkins_pipeline_at\/tree\/master\">https:\/\/github.com\/DaryaMin\/jenkins_pipeline_at\/tree\/master<\/a>  <\/p>\n<\/blockquote>\n<hr\/>\n<h2>Pipeline \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c\u00a0pipeline \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e.  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u0438:<\/p>\n<p><a class=\"anchor\" name=\"content\" id=\"content\"><\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#environment\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#parametrs\">\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#credentials\">Credentials<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#triggers\">\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0441\u0431\u043e\u0440\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#stages\">\u042d\u0442\u0430\u043f\u044b\/stages<\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#git\">\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#run\">\u0437\u0430\u043f\u0443\u0441\u043a \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#allure\">\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#post\">\u041d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#scm\">Pipeline from SCM<\/a><\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<p><a class=\"anchor\" name=\"environment\" id=\"environment\"><\/a><\/p>\n<h3>1. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/h3>\n<p>Pipeline \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 \u043d\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0434\u043e\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <strong>environment.\u00a0<\/strong>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u043a\u043b\u044e\u0447 = &#8216;\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&#8217;.<\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 ${env.&lt;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439>}, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: ${env.mailRecipients}<\/p>\n<pre><code class=\"java\">environment { \u00a0 \u00a0 \u00a0 \u00a0 allureResults = 'target\/allure-results', \u00a0 \u00a0 \u00a0 \u00a0 allureReportPolicy = 'ALWAYS', \u00a0 \u00a0 \u00a0 \u00a0 mailRecipients = 'test@cinimex.ru,\u00a0dminakova@cinimex.ru' \u00a0 \u00a0 }<\/code><\/pre>\n<p> <a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"parametrs\" id=\"parametrs\"><\/a><\/p>\n<h3>2. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<p>\u0412 Pipeline \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0431\u043e\u0440\u0430 \u043f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0443. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: url \u0441\u0442\u0435\u043d\u0434\u0430, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u044c\u044e\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0442.\u043f.<\/p>\n<p>\u041a\u043e\u0434\u043e\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e &#8212; <strong>parameters<\/strong>.<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435.\u00a0<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>string<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>parameters { string(name: 'DEPLOY_ENV', defaultValue: 'staging', description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>text<br \/>\u041c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>parameters { text(name: 'DEPLOY_TEXT', defaultValue: 'One\\nTwo\\nThree\\n', description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>booleanParam<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u0438\u043d\u0430\/\u043b\u043e\u0436\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>parameters { booleanParam(name: 'DEBUG_BUILD', defaultValue: true, description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>choice<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0436\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a \u0432\u044b\u0431\u043e\u0440\u0443. \u0427\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u044c\u044e\u0442\u0430 (\u0440\u0435\u0433\u0440\u0435\u0441\u0441, \u0441\u043c\u043e\u043a, \u0434\u0435\u0431\u0430\u0433), \u0442.\u043a. \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u044c\u044e\u0442\u043e\u0432 \u0440\u0435\u0434\u043a\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f.<br \/><code>parameters { choice(name: 'CHOICES', choices: ['one', 'two', 'three'], description: '') }<\/code><\/p>\n<\/li>\n<li>\n<p>password<br \/>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u044f.<br \/><code>parameters { password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'A secret password')\u00a0<\/code><\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>gitParameter<\/strong>. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Jenkins \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c Git Parametr. <code>parameters { gitParameter(name: 'BRANCH', defaultValue: 'develop', description: '\u0412\u0435\u0442\u043a\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0435\u043f\u043b\u043e\u0438\u043c\u0441\u044f', branchFilter: 'origin\/(.*)', type: 'PT_BRANCH', selectedValue: 'DEFAULT')}<\/code><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">pipeline {     agent any     parameters {         string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')          text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')          booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')          choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')          password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')     }     stages {         stage('Example') {             steps {                 echo \"Hello ${params.PERSON}\"                  echo \"Biography: ${params.BIOGRAPHY}\"                  echo \"Toggle: ${params.TOGGLE}\"                  echo \"Choice: ${params.CHOICE}\"                  echo \"Password: ${params.PASSWORD}\"             }         }     } }<\/code><\/pre>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0431\u043e\u0440\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c jenkins<\/figcaption><\/div>\n<\/figure>\n<\/div>\n<\/details>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"credentials\" id=\"credentials\"><\/a><\/p>\n<hr\/>\n<h3>3. Credentials<\/h3>\n<figure class=\"float full-width\"><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Jenkins \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 echo \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f\u00a0Groovy String interpolation \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c.\u00a0<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435?!<\/p>\n<figure class=\"float\"><\/figure>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 &#8212; \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <strong>\u0434\u0432\u043e\u0439\u043d\u044b\u0435<\/strong> \u043a\u0430\u0432\u044b\u0447\u043a\u0438 <strong>\u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435<\/strong>.<br \/>\u041e \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c\u00a0credentials(). <\/p>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u0435\u0442\u043e\u0434 <strong>credentials()<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>secret text<\/p>\n<\/li>\n<li>\n<p>usernames and passwords<\/p>\n<\/li>\n<li>\n<p>secret files<\/p>\n<\/li>\n<li>\n<p>Jenkins&#8217;\u00a0Snippet Generator\u00a0\u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 credential \u0432 Jenkins<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b credentials<\/p>\n<figure class=\"\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0430\u043f\u043a\u0443<\/p>\n<figure class=\"\"><\/figure>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u043e\u043c\u0435\u043d<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 credentials. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043c\u0435\u043d\u044e: Add credentials<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<li>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0442\u0438\u043f Username and Password. \u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Jenkins \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 Vault.\u00a0 \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439\u00a0<a href=\"https:\/\/plugins.jenkins.io\/hashicorp-vault-plugin\/\">https:\/\/plugins.jenkins.io\/hashicorp-vault-plugin\/<\/a><\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0427\u0435\u043a-\u0431\u043e\u043a\u0441\u00a0Treat username as secret \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 username \u043d\u0430 \u0441\u043f\u0438\u0441\u043a\u0435 credentials<br \/>ID \u0435\u0441\u043b\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b credentials \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:<\/p>\n<pre><code class=\"java\">environment {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0TEST_CREDS = credentials('4444444444444')  \u00a0\u00a0\u00a0\u00a0}<\/code><\/pre>\n<p>\u0437\u0434\u0435\u0441\u044c TEST_CREDS &#8212; \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0430 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u0430\u043d ID credentials<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 user:password. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e user \u0438\u043b\u0438 password \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f _USR \u0438\u043b\u0438 _PSW \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u0430$ \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d credentials \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"java\">pipeline {     agent {         node {             label 'jenkins-vm.company.ru'         }     }       parameters {         string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')           text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')           booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')           choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')           password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')     }     environment {         TEST_CREDS = credentials('4444444444')     }     stages {         stage('Example') {             steps {                 echo \"Hello ${params.PERSON}\"                   echo \"Biography: ${params.BIOGRAPHY}\"                   echo \"Toggle: ${params.TOGGLE}\"                   echo \"Choice: ${params.CHOICE}\"                   echo 'Password: ${params.PASSWORD}'                                   echo 'from credentials: $TEST_CREDS'                                   echo \"user from credentials: $TEST_CREDS_USR\"                                   echo \"password from credentials: $TEST_CREDS_PSW\"             }         }     } }<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u043e\u0439\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u041d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439, \u043e \u0447\u0435\u043c \u043d\u0430\u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 Jenkins. \u0418 <strong>\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438<\/strong>.<\/p>\n<\/div>\n<\/details>\n<p><a href=\"#content\">\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e<\/a><\/p>\n<p><a class=\"anchor\" name=\"triggers\" id=\"triggers\"><\/a><\/p>\n<hr\/>\n<h3>4. \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0441\u0431\u043e\u0440\u043a\u0438<\/h3>\n<figure class=\"float full-width\"><\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043e\u0432 \u0441\u0431\u043e\u0440\u043a\u0438:<br \/>    &#8212; \u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u043a\u0438\u00a0<br \/>    &#8212; \u0421\u0442\u0430\u0440\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<br \/>    &#8212; \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 <br \/>    &#8212; \u041f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 GitLab<br \/>    &#8212; \u0422\u0440\u0438\u0433\u0433\u0435\u0440 \u0438\u0437 \u0430\u0440\u0442\u0438\u0444\u0430\u043a\u0442\u043e\u0440\u0438<br \/>    &#8212; \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b GitHub<br \/>    &#8212; Scm \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u00a0<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 &#8212;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-363701","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363701","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=363701"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363701\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}