{"id":379910,"date":"2024-06-25T21:00:08","date_gmt":"2024-06-25T21:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=379910"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=379910","title":{"rendered":"<span>\u041f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 DevOps: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c GitLab \u0438 GitLab Runners \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e<\/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<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 GitLab Runners \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Docker Compose. \u042d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 GitLab CI\/CD. \u041c\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b: \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0434\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0432\u044b \u0432 CI\/CD \u0438\u043b\u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u044d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0430\u043c \u0446\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c GitLab Runner, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c GitLab \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e GitLab.com, \u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435, \u0447\u0430\u0441\u0442\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 GitLab. \u0418\u043c\u0435\u044f \u043d\u0430\u0432\u044b\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0443, \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0443\u044e \u0442\u043e\u0439, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f CI\/CD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438:<\/h2>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440?<\/h3>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u0443\u0447\u0438\u0442\u044c GitLab CI\/CD \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435<\/p>\n<\/li>\n<li>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0443 \u0434\u043b\u044f \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 CI\/CD \u043f\u0440\u0430\u043a\u0442\u0438\u043a<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<h3>\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 GitLab \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435?<\/h3>\n<h4>1. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/h4>\n<pre><code class=\"bash\">mkdir -p .\/data\/docker\/gitlab\/{var\/opt\/gitlab,var\/log\/gitlab,etc\/gitlab-runner,var\/run\/docker.sock} mkdir -p .\/config touch .\/config\/config.toml<\/code><\/pre>\n<h4>2. \u0417\u0430\u043f\u0443\u0441\u043a Docker Compose:<\/h4>\n<p><a href=\"https:\/\/gist.github.com\/denisxab\/2f35c8f91ed1207116760dab3f86bdd6\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 docker-compose.yml<\/a><\/p>\n<pre><code class=\"bash\">docker-compose up --build<\/code><\/pre>\n<h4>3. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 GitLab:<\/h4>\n<ul>\n<li>\n<p>URL: <code>http:\/\/localhost:8000\/<\/code><\/p>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438\u043d: <code>root<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0430\u0440\u043e\u043b\u044c: <code>CHANGEME123<\/code><\/p>\n<\/li>\n<\/ul>\n<h4>4. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SSH-\u043a\u043b\u044e\u0447\u0430:<\/h4>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <code>http:\/\/localhost:8000\/-\/user_settings\/ssh_keys<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0430\u0448\u0435\u0433\u043e <code>~\/.ssh\/id_rsa.pub<\/code><\/p>\n<\/li>\n<\/ol>\n<h3>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f GitLab Runner \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0432 Docker<\/h3>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 <code>docker-compose.yml<\/code> \u0444\u0430\u0439\u043b <code>.env<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code>RUNNER_NAME=\u0418\u043c\u044f\u041f\u0440\u043e\u0435\u043a\u0442\u0430 REGISTRATION_TOKEN=\u0412\u0430\u0448\u0422\u043e\u043a\u0435\u043d\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438<\/code><\/pre>\n<blockquote>\n<p><code>REGISTRATION_TOKEN<\/code> &#8212; \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 <code>http:\/\/localhost:8000\/root\/${\u041f\u0440\u043e\u0435\u043a\u0442}\/-\/settings\/ci_cd<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>Runner's<\/code>-> <code>Project runners<\/code> -> <code>:<\/code> -> <code>\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/code><\/p>\n<\/blockquote>\n<ol start=\"2\">\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 <code>register-runner<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">docker-compose restart register-runner<\/code><\/pre>\n<h3>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 GitLab Runner<\/h3>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <code>register-runner<\/code>:<\/p>\n<pre><code class=\"bash\"># \u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0441\u0435\u0445 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner run  # \u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner list  # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner verify  # \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner unregister --all-runners  # \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u043d\u0435\u0440\u0430 gitlab-runner unregister --name ${name_runner}  # \u0424\u0430\u0439\u043b \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 vim \/etc\/gitlab-runner\/config.toml<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 GitLab CI\/CD<\/h3>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 GitLab, \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <code>test<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 runner. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442: <code>git clone ssh:\/\/git@localhost:8822\/root\/test.git<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0435\u0442\u043a\u0443: <code>git checkout -b test_ci<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u0430\u0439\u043b <code>main.py<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def main():     print('Hello World')  main()<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>.gitlab-ci.yml<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">stages:     - linting  variables:     COMMIT_MESSAGE_PATTERN: \"^.{0,10}:[[:space:]]#[0-9]{5,6}[[:space:]].{5,150}$\"  .default_rules: &amp;default_rules     rules:         - if: '$CI_COMMIT_BRANCH != \"main\" &amp;&amp; $CI_PIPELINE_SOURCE == \"merge_request_event\"'  commit-name-test:     stage: linting     &lt;&lt;: *default_rules     script:         - |             if [[ \"$CI_COMMIT_MESSAGE\" =~ $COMMIT_MESSAGE_PATTERN ]]; then               echo \"\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0438\u0442\u0430\"             else               echo \"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: $CI_COMMIT_MESSAGE\"               exit 1             fi  pylint:     stage: linting     &lt;&lt;: *default_rules     image: python:3.9     before_script:         - pip install pylint     script:         - pylint **\/*.py <\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u0417\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <code>git add -A &amp;&amp; git commit -m \"feat: #12345 \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d CI \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\"<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <code>git push -u origin test_ci<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 Merge Request \u0432 GitLab<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;\u0421\u0431\u043e\u0440\u043e\u0447\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f&#187;<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 GitLab CI\/CD \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d-\u0441\u0440\u0435\u0434\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/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\/824514\/\"> https:\/\/habr.com\/ru\/articles\/824514\/<\/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<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 GitLab Runners \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Docker Compose. \u042d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 GitLab CI\/CD. \u041c\u044b \u043f\u0440\u043e\u0439\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b: \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0434\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430. \u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u043e\u0432\u0438\u0447\u043e\u043a \u0432\u044b \u0432 CI\/CD \u0438\u043b\u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u044d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0430\u043c \u0446\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c GitLab Runner, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c GitLab \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e GitLab.com, \u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435, \u0447\u0430\u0441\u0442\u043e \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 GitLab. \u0418\u043c\u0435\u044f \u043d\u0430\u0432\u044b\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0443, \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0443\u044e \u0442\u043e\u0439, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f CI\/CD \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438:<\/h2>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440?<\/h3>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<ol>\n<li>\n<p>\u0418\u0437\u0443\u0447\u0438\u0442\u044c GitLab CI\/CD \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435<\/p>\n<\/li>\n<li>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0443 \u0434\u043b\u044f \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 CI\/CD \u043f\u0440\u0430\u043a\u0442\u0438\u043a<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<h3>\u041a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 GitLab \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435?<\/h3>\n<h4>1. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/h4>\n<pre><code class=\"bash\">mkdir -p .\/data\/docker\/gitlab\/{var\/opt\/gitlab,var\/log\/gitlab,etc\/gitlab-runner,var\/run\/docker.sock} mkdir -p .\/config touch .\/config\/config.toml<\/code><\/pre>\n<h4>2. \u0417\u0430\u043f\u0443\u0441\u043a Docker Compose:<\/h4>\n<p><a href=\"https:\/\/gist.github.com\/denisxab\/2f35c8f91ed1207116760dab3f86bdd6\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 docker-compose.yml<\/a><\/p>\n<pre><code class=\"bash\">docker-compose up --build<\/code><\/pre>\n<h4>3. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 GitLab:<\/h4>\n<ul>\n<li>\n<p>URL: <code>http:\/\/localhost:8000\/<\/code><\/p>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438\u043d: <code>root<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0430\u0440\u043e\u043b\u044c: <code>CHANGEME123<\/code><\/p>\n<\/li>\n<\/ul>\n<h4>4. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SSH-\u043a\u043b\u044e\u0447\u0430:<\/h4>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 <code>http:\/\/localhost:8000\/-\/user_settings\/ssh_keys<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0430\u0448\u0435\u0433\u043e <code>~\/.ssh\/id_rsa.pub<\/code><\/p>\n<\/li>\n<\/ol>\n<h3>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f GitLab Runner \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0432 Docker<\/h3>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 <code>docker-compose.yml<\/code> \u0444\u0430\u0439\u043b <code>.env<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code>RUNNER_NAME=\u0418\u043c\u044f\u041f\u0440\u043e\u0435\u043a\u0442\u0430 REGISTRATION_TOKEN=\u0412\u0430\u0448\u0422\u043e\u043a\u0435\u043d\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438<\/code><\/pre>\n<blockquote>\n<p><code>REGISTRATION_TOKEN<\/code> &#8212; \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 <code>http:\/\/localhost:8000\/root\/${\u041f\u0440\u043e\u0435\u043a\u0442}\/-\/settings\/ci_cd<\/code> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <code>Runner's<\/code>-> <code>Project runners<\/code> -> <code>:<\/code> -> <code>\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/code><\/p>\n<\/blockquote>\n<ol start=\"2\">\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 <code>register-runner<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">docker-compose restart register-runner<\/code><\/pre>\n<h3>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 GitLab Runner<\/h3>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <code>register-runner<\/code>:<\/p>\n<pre><code class=\"bash\"># \u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0441\u0435\u0445 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner run  # \u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner list  # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner verify  # \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 gitlab-runner unregister --all-runners  # \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u043d\u0435\u0440\u0430 gitlab-runner unregister --name ${name_runner}  # \u0424\u0430\u0439\u043b \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0440\u0430\u043d\u043d\u0435\u0440\u043e\u0432 vim \/etc\/gitlab-runner\/config.toml<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 GitLab CI\/CD<\/h3>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 GitLab, \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <code>test<\/code><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 runner. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442: <code>git clone ssh:\/\/git@localhost:8822\/root\/test.git<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0435\u0442\u043a\u0443: <code>git checkout -b test_ci<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u0430\u0439\u043b <code>main.py<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\">def main():     print('Hello World')  main()<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>.gitlab-ci.yml<\/code>:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">stages:     - linting  variables:     COMMIT_MESSAGE_PATTERN: \"^.{0,10}:[[:space:]]#[0-9]{5,6}[[:space:]].{5,150}$\"  .default_rules: &amp;default_rules     rules:         - if: '$CI_COMMIT_BRANCH != \"main\" &amp;&amp; $CI_PIPELINE_SOURCE == \"merge_request_event\"'  commit-name-test:     stage: linting     &lt;&lt;: *default_rules     script:         - |             if [[ \"$CI_COMMIT_MESSAGE\" =~ $COMMIT_MESSAGE_PATTERN ]]; then               echo \"\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043c\u0438\u0442\u0430\"             else               echo \"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: $CI_COMMIT_MESSAGE\"               exit 1             fi  pylint:     stage: linting     &lt;&lt;: *default_rules     image: python:3.9     before_script:         - pip install pylint     script:         - pylint **\/*.py <\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u0417\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <code>git add -A &amp;&amp; git commit -m \"feat: #12345 \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d CI \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\"<\/code><\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: <code>git push -u origin test_ci<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 Merge Request \u0432 GitLab<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;\u0421\u0431\u043e\u0440\u043e\u0447\u043d\u0430\u044f \u043b\u0438\u043d\u0438\u044f&#187;<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 GitLab CI\/CD \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d-\u0441\u0440\u0435\u0434\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/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\/824514\/\"> https:\/\/habr.com\/ru\/articles\/824514\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-379910","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/379910","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=379910"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/379910\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}