{"id":343024,"date":"2022-12-22T15:03:28","date_gmt":"2022-12-22T15:03:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343024"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343024","title":{"rendered":"<span>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 gitlab-ci \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u043e\u043d\u0442\u0430, \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Gitlab-CI.<\/p>\n<p>  <\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/docs.gitlab.com\/ee\/ci\/\" rel=\"nofollow noopener noreferrer\">GitLab-CI<\/a>, \u0430 \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 GitLab Runner (\u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435) \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0440\u043e\u043f\u043b\u0435\u0442 \u043e\u0442 <a href=\"https:\/\/www.digitalocean.com\/\" rel=\"nofollow noopener noreferrer\">DO<\/a><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>GitLab<\/h2>\n<p>  <\/p>\n<blockquote><p>GitLab \u2014 \u044d\u0442\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043a\u043e\u0434\u0430, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 Git, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 GitHub. \u041e\u0431\u044b\u0447\u043d\u043e \u043e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 Git \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0442\u044f\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0438 \u0448\u043a\u043e\u043b\u044b.<\/p><\/blockquote>\n<p>  <\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0445\u043e\u0440\u043e\u0448\u0430\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9D%D0%B5%D0%BF%D1%80%D0%B5%D1%80%D1%8B%D0%B2%D0%BD%D0%B0%D1%8F_%D0%B8%D0%BD%D1%82%D0%B5%D0%B3%D1%80%D0%B0%D1%86%D0%B8%D1%8F\" rel=\"nofollow noopener noreferrer\">\u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f<\/a>, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0412\u0438\u043a\u0438.<\/p>\n<p>  <\/p>\n<h2>.gitlab-ci.yml<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Git, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0440\u044f\u0434 \u044d\u0442\u0430\u043f\u043e\u0432 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. GitLab-CI \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0443\u0448\u0430 \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 Gitlab-runner(\u0430) \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Git \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 Remote (\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 gitlab.com), \u0430 \u0437\u0430\u0442\u0435\u043c Gitlab \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442 \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Gitlab-runner, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0431\u043e\u0440\u043a\u0438.   <\/p><\/blockquote>\n<p>  <\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Gitlab Runner:<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 Ubuntu<br \/>  <b>\u0421\u043a\u0430\u0447\u0430\u0442\u044c<\/b><\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">curl -LJO https:\/\/gitlab-runner-downloads.s3.amazonaws.com\/latest\/deb\/gitlab-runner_amd64.deb<\/code><\/pre>\n<p>  <\/p>\n<p><b>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c<\/b><\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">dpkg -i gitlab-runner_amd64.deb<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 Gitlab Runner, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 Gitlab, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u043d \u0441\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<h2>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 Runner \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Ubuntu:<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo gitlab-runner register<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL-\u0430\u0434\u0440\u0435\u0441 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 GitLab:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">Please enter the gitlab-ci coordinator URL (e.g. https:\/\/gitlab.com ) https:\/\/gitlab.xxx.com<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 Runner:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">Please enter the gitlab-ci token for this runner xxx<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ng\/6r\/vk\/ng6rvkg11avryncii59j0hbnfys.png\" width=\"350\" data-src=\"https:\/\/habrastorage.org\/webt\/ng\/6r\/vk\/ng6rvkg11avryncii59j0hbnfys.png\"\/>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0420\u0430\u043d\u0435\u0440\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">Please enter the gitlab-ci description for this runner [hostname] my-runner<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0442\u044d\u0433\u0430, <strong>\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0443\u0441\u0442\u044b\u043c!<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">Please enter the gitlab-ci tags for this runner (comma separated): my-tag,another-tag<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f Runner:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell: docker \/\/ \u041c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 Docker, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Docker, \u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Docker \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u0442\u0435 Docker \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044f, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0432 .gitlab-ci.yml:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">Please enter the Docker image (eg. ruby:2.6): alpine:latest<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/bw\/kg\/9w\/bwkg9wsqc9tpnigiyqhv2qouywm.png\" width=\"350\" data-src=\"https:\/\/habrastorage.org\/webt\/bw\/kg\/9w\/bwkg9wsqc9tpnigiyqhv2qouywm.png\"\/>  <\/p>\n<p>\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0437\u0435\u043b\u0435\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c.<br \/>  \u041d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0430\u0439\u0442\u0435, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u0442\u0430\u043a. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0439\u0442\u0435 Docker \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0442\u0435\u0441\u044c \u043a \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"konfiguraciya-gitlab-ciyml\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f .gitlab-ci.yml<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Runner \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b .gitlab-ci.yml \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0444\u0430\u0439\u043b .gitlab-ci.yml, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c MR, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"pipeline\">Pipeline<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u2014 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0437\u0430\u0434\u0430\u0447\u0435 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f, \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u041b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0438\u043b\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0439 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">+------------------+           +----------------+ |                  |  trigger  |                | |   Commit \/ MR    +---------->+    Pipeline    | |                  |           |                | +------------------+           +----------------+<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"stages\">Stages<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u0430\u043f\u044b \u2014 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u044d\u0442\u0430\u043f \u0441\u0431\u043e\u0440\u043a\u0438, \u0438, \u043f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0432\u044b\u0448\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432 \u0432 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u0442\u0430\u043f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u042d\u0442\u0430\u043f\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0412\u0441\u0435 \u044d\u0442\u0430\u043f\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u0430\u043f \u043d\u0435 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439<\/li>\n<li>\u0422\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b \u0432\u0441\u0435 \u044d\u0442\u0430\u043f\u044b, \u0441\u0430\u043c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u044d\u0442\u0430\u043f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e, \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u0442\u0430\u043f\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u0441\u0430\u043c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0438 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">+--------------------------------------------------------+ |                                                        | |  Pipeline                                              | |                                                        | |  +-----------+     +------------+      +------------+  | |  |  Stage 1  |---->|   Stage 2  |----->|   Stage 3  |  | |  +-----------+     +------------+      +------------+  | |                                                        | +--------------------------------------------------------+<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"jobs\">Jobs<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0431\u043e\u0447\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u2014 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 \u044d\u0442\u0430\u043f\u0430\u0445, \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0417\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e<\/li>\n<li>\u042d\u0442\u0430\u043f \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0430\u0434\u0438\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0431\u043e\u0439 \u044d\u0442\u0430\u043f\u0430, \u0442.\u0435. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0431\u043e\u0439 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 (\u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 Jobs \u0438 Stage \u0442\u0430\u043a\u043e\u0432\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">+------------------------------------------+ |                                          | |  Stage 1                                 | |                                          | |  +---------+  +---------+  +---------+   | |  |  Job 1  |  |  Job 2  |  |  Job 3  |   | |  +---------+  +---------+  +---------+   | |                                          | +------------------------------------------+<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"davayte-pogovorim-o-nekotoryh-bazovyh-strukturah-gitlab-ciyml\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 .gitlab-ci.yml<\/h3>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Node.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">image: node:alpine  \/\/ \u041e\u0431\u0440\u0430\u0437 Docker \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f ci \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e  stages:  \/\/ \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432. \u0412\u0441\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e   - test     - build  job1:   stage: test  \/\/ \u041f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a \u0441\u0442\u0430\u0434\u0438\u0438 \u0442\u0435\u0441\u0442\u0430   script:     - npm run test \/\/ \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u044d\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0439   only:     - master  \/\/ \u0421\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u043a\u043e\u0434\u0430 \u0438\u0437 \u0432\u0435\u0442\u043a\u0438 master   tags:     - marat  \/\/ \u041a\u0430\u043a\u043e\u0439 Runner \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e, \u0432\u044b\u0448\u0435 \u044f \u043f\u0440\u043e\u0441\u0438\u043b \u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0443\u0441\u0442\u044b\u043c.)  job2:   stage: build   script:     - npm run build   only:     - master   tags:     - marat<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u0430 job1 \u0438 job2 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c\u0438, \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 Gitlab-CI:<\/p>\n<p>  <\/p>\n<p><strong>\u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <\/strong> \u2014 <em>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/em><\/p>\n<p>  <\/p>\n<p><strong>image<\/strong> \u2014 <em>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0436\u0435\u043a\u0442\u0430 Docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432<\/em><br \/>  <strong>services<\/strong> \u2014 <em>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043b\u0443\u0436\u0431\u044b \u0434\u043e\u043a\u0435\u0440\u043e\u0432 <\/em><br \/>  <strong>stage<\/strong> \u2014 <em> \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0430\u043f \u0441\u0431\u043e\u0440\u043a\u0438<\/em><br \/>  <strong>before_script<\/strong> \u2014 <em> \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c<\/em><br \/>  <strong>after_script<\/strong> \u2014 <em> \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f <\/em><br \/>  <strong>variable<\/strong> \u2014 <em>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438<\/em><br \/>  <strong>cache<\/strong> \u2014 <em>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0445<\/em><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u044f\u0441\u043d\u043e \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c \u0441\u043b\u043e\u0432\u0435 \u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"skachaem-vue3\">\u0421\u043a\u0430\u0447\u0430\u0435\u043c Vue3<\/h2>\n<p>  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/vuejs\/vue-next-webpack-preview.git vue3 cd vue3 npm install npm run dev<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \ud83d\ude42<br \/>  \u041e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e webpack \u0438 \u0437\u0430\u0442\u0435\u043c <del>\u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f nginx \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430.<\/del> \u043f\u043e-\u0445\u0438\u043f\u0441\u0442\u0435\u0440\u0441\u043a\u0438, \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u043d\u0430 <a href=\"https:\/\/surge.sh\/\" rel=\"nofollow noopener noreferrer\">https:\/\/surge.sh\/<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">image: node:alpine  stages:   - build   - deploy  cache:   paths:   -  node_modules\/  build process:   stage: build   script:     - npm install --progress=false     - npm run build   artifacts:     expire_in: 1 week     paths:       - dist  deploy to surge:   stage: deploy   script:     - npx surge --project .\/dist --domain xxx.surge.sh<\/code><\/pre>\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\/post\/707112\/\"> https:\/\/habr.com\/ru\/post\/707112\/<\/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-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u043e\u043d\u0442\u0430, \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Gitlab-CI.<\/p>\n<p>  <\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/docs.gitlab.com\/ee\/ci\/\" rel=\"nofollow noopener noreferrer\">GitLab-CI<\/a>, \u0430 \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 GitLab Runner (\u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435) \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0440\u043e\u043f\u043b\u0435\u0442 \u043e\u0442 <a href=\"https:\/\/www.digitalocean.com\/\" rel=\"nofollow noopener noreferrer\">DO<\/a><\/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-343024","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343024","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=343024"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343024\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}