{"id":451517,"date":"2025-03-12T09:02:38","date_gmt":"2025-03-12T09:02:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=451517"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=451517","title":{"rendered":"<span>DevOps \u043d\u0435\u0442, \u043d\u043e \u0432\u044b \u0434\u0435\u0440\u0436\u0438\u0442\u0435\u0441\u044c: \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 MR<\/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>\u0421\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Polymatica EPM (\u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0431\u044e\u0434\u0436\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438: \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430\u00a0\u0441\u0442\u0435\u043a\u0435 FastAPI + Poetry + Pytest. \u0418\u0437\u2011\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0435\u0441\u0442\u044b, \u0432\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435. \u0412\u0441\u0435 \u0448\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u043e\u0441\u043b\u0430, \u0442\u0435\u0441\u0442\u044b \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c, \u043d\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u043c\u0438. \u041d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 Merge Request (MR).<\/p>\n<p>\u041d\u0430\u00a0\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u00a0\u043d\u0430\u0441\u00a0\u0431\u044b\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 CI\/CD, \u043d\u043e\u00a0\u0440\u0435\u0441\u0443\u0440\u0441\u044b DevOps\u00a0\u0431\u044b\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u0441\u0438\u043b\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u0411\u043e\u0433\u0434\u0430\u043d\u043e\u0432, \u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u044d\u043a\u0435\u043d\u0434\u2011\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0438 \u0432\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a\u00a0\u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432, \u0441\u00a0\u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f\u00a0CI\/CD.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b57\/af5\/c90\/b57af5c9051a0ed6ea94c3a2f76182df.png\" width=\"740\" height=\"417\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b57\/af5\/c90\/b57af5c9051a0ed6ea94c3a2f76182df.png\"\/><\/figure>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<ol>\n<li>\n<p><strong>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u00a0CI\/CD\u2011\u0432\u043e\u0440\u043a\u0435\u0440\u0435 \u0438\u043b\u0438\u00a0\u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437.<\/strong><\/p>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b: \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438, \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u00a0\u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442\u00a0\u0436\u0435 image, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u2011\u0441\u0442\u0435\u043d\u0434.<\/strong><\/p>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u00a0\u0441\u0431\u043e\u0440\u043a\u0435 \u0441\u0442\u0435\u043d\u0434\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u043e\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f\u00a0\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u00a0\u043e\u043f\u044f\u0442\u044c\u00a0\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435.<\/strong><\/p>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b: \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0430\u00a0\u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043d\u043e\u0432\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u2011\u043e\u0431\u0440\u0430\u0437.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 <strong>\u0442\u0440\u0435\u0442\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/strong>, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u043b \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u0435\u0436\u0434\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<h2>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<h3>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h3>\n<pre><code> monorep\/ \u251c\u2500\u2500 service_1\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_2\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_3\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 .gitlab_ci.yml<\/code><\/pre>\n<p>monorep\/\u00a0\u2014 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<br \/>service_1\/, service_2\/, service_3\/\u00a0\u2014 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0441\u00a0\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>Dockerfile\u00a0\u2014 \u0444\u0430\u0439\u043b \u0434\u043b\u044f\u00a0\u0441\u0431\u043e\u0440\u043a\u0438 Docker\u2011\u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<\/li>\n<li>\n<p>pyproject.toml\u00a0\u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0Poetry.<\/p>\n<\/li>\n<li>\n<p>poetry.lock\u00a0\u2014 \u0444\u0430\u0439\u043b \u0441\u00a0\u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>app\/\u00a0\u2014 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u00a0\u043a\u043e\u0434\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0442\u0443\u0442\u00a0\u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u00a0\u043a\u043e\u0440\u043d\u0435 \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f:<br \/>.gitlab_ci.yml\u00a0\u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0GitLab CI\/CD.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u00a0\u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Dockerfile \u0434\u043b\u044f \u00ab\u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430\u00bb.<\/p>\n<h3>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u0443\u00a0\u2014 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u00a0\u043d\u0430\u0448\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u00a0poetry, \u0432\u00a0\u0446\u0435\u043b\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043a, \u043e\u0434\u043d\u0430\u043a\u043e\u00a0\u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 polars). \u0414\u043b\u044f\u00a0\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 requirements.txt \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">poetry export --without-hashes \u2011f requirements.txt \u2011output requirements1.txt<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e requirements.txt, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u043d\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 python:<\/p>\n<pre><code class=\"python\">import argparse from packaging.requirements import Requirement, InvalidRequirement   def parse_requirements(file_path): dependencies = {} options = set() with open(file_path, 'r') as f:     for line in f:         line = line.strip()         if not line or line.startswith('#'):             continue                  if ' -- ' in line:             dep_part, options_part = line.split(' -- ', 1)             current_options = [' -- ' + opt.strip() for opt in options_part.split(' -- ')]             options.update(current_options)         else:             dep_part = line             current_options = []          dep_part = dep_part.split(';')[0].strip()         if not dep_part:             continue          try:             req = Requirement(dep_part)             dep_name = req.name             dependencies[dep_name] = dep_part         except InvalidRequirement:             print(f\"\u26a0\ufe0f \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430: '{dep_part}' \u0432 \u0444\u0430\u0439\u043b\u0435 {file_path} \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430.\")             continue  return dependencies, options  def main(): parser = argparse.ArgumentParser(description='\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e requirements.txt') parser.add_argument('files', nargs='+', help='\u0421\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f') parser.add_argument('-o', '--output', default='requirements_all.txt', help='\u0412\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b') args = parser.parse_args()  all_options = set() combined_deps = {} seen_files = set()  for file_path in args.files:     if file_path in seen_files:         continue     seen_files.add(file_path)          deps, opts = parse_requirements(file_path)     all_options.update(opts)          for dep_name, dep_spec in deps.items():         if dep_name in combined_deps:             print(f\"\u26a0\ufe0f \u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442: {dep_name} \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 {file_path} ({dep_spec})\")         combined_deps[dep_name] = dep_spec  sorted_options = sorted(all_options) sorted_deps = sorted(combined_deps.items(), key=lambda x: x[0].lower())  with open(args.output, 'w') as f:     if sorted_options:         f.write('\\n'.join(sorted_options) + '\\n\\n')     for dep_name, dep_spec in sorted_deps:         f.write(f\"{dep_spec}\\n\")  print(f\"\u2705 \u0424\u0430\u0439\u043b {args.output} \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d!\")  if __name__ == '__main__': main()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"bash\">pip install packaging python merge_requirements.py requirements1.txt requirements2.txt requirements3.txt -o requirements_all.txt<\/code><\/pre>\n<h3>\u041f\u0438\u0448\u0435\u043c Dockerfile \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430<\/h3>\n<pre><code class=\"python\">FROM python:3.10.12-slim  RUN pip install --no-cache-dir --upgrade pip  COPY .\/requirements_all.txt requirements_all.txt RUN pip install -r requirements_all.txt<\/code><\/pre>\n<h3>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h3>\n<pre><code>monorep\/ \u251c\u2500\u2500 service_1\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_2\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_3\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 .gitlab_ci.yml \u251c\u2500\u2500 Dockerfile_gitlab \u2514\u2500\u2500 requirements_all.txt<\/code><\/pre>\n<h2>CI \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Gitlab<\/h2>\n<p>\u0421\u0431\u043e\u0440\u043a\u0443 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433. \u0415\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0435\u0434\u043a\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u00a0\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0434\u043b\u044f\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 MR \u0438 \u043f\u0440\u0438\u00a0\u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u0434\u043b\u044f\u00a0\u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<pre><code class=\"yaml\">image: alpine   variables:   PRETEST: pretest    stages:   - pretest   - test   - dockerize  pretest:   stage: pretest   image: alpine:latest   only: changes:   - requirements_all.txt   - Dockerfile_gitlab   script: - apk add --no-cache bash docker - IMAGE=${CI_REGISTRY_IMAGE}\/${PRETEST} - DOCKERFILE=\"-f Dockerfile_gitlab\" - docker build $DOCKERFILE -t ${IMAGE}:$IMAGE_VERSION . - docker push ${IMAGE}:$IMAGE_VERSION - docker tag ${IMAGE}:$IMAGE_VERSION ${IMAGE}:latest - docker push ${IMAGE}:latest - echo $IMAGE:$IMAGE_VERSION &gt; IMAGE_${PRETEST}   artifacts: paths:   - IMAGE_\/c{PRETEST}   when: manual   allow_failure: true   ### Test ###   .test_template: &amp;test_template   stage: test   image: ${CI_REGISTRY_IMAGE}\/${PRETEST}:latest   allow_failure: true   rules: - if: $CI_PIPELINE_SOURCE == \"merge_request_event\" &amp;&amp; $CI_JOB_NAME == \"service1:test\"   changes:     - service1\/**\/*   when: always - if: $CI_PIPELINE_SOURCE == \"merge_request_event\" &amp;&amp; $CI_JOB_NAME == \"service2:test\"   changes:     - service2\/**\/*   when: always - if: $CI_PIPELINE_SOURCE == \"merge_request_event\" &amp;&amp; $CI_JOB_NAME == \"service3:test\"   changes:     - service3\/**\/*   when: always - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service1:test\"   changes:     - service1\/**\/*   when: always - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service2:test\"   changes:     - service2\/**\/*   when: always - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service3:test\"   changes:     - service3\/**\/*   when: always - when: never   script: - cd ${SERVICE}_service - python --version - |   if [[ -f \"migrate.py\" ]]; then     python migrate.py   fi - pytest tests -vv --color yes --cov --cov-report term --cov-report xml:coverage.xml --junitxml=report.xml - cd ..   coverage: '\/(?i)total.*? (100(?:\\.0+)?\\%|[1-9]?\\d(?:\\.\\d+)?\\%)$\/'   artifacts: reports:   coverage_report:     coverage_format: cobertura     path: ${SERVICE}_service\/coverage.xml   junit: ${SERVICE}_service\/report.xml   service1:test:   variables: SERVICE: service1   &lt;&lt;: *test_template   service2:test:   variables: SERVICE: service2   &lt;&lt;: *test_template   service3:test:   variables: SERVICE: service3   &lt;&lt;: *test_template  ### Dockerize ###   .dockerize_template: &amp;dockerize_template   stage: dockerize   image: alpine:latest   rules: - if: $CI_PIPELINE_SOURCE == \"merge_request_event\"   when: never - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service1:dockerize\"   changes:     - service1\/**\/*   when: on_success   allow_failure: true - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service2:dockerize\"   changes:     - service2\/**\/*   when: on_success   allow_failure: true - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service3:dockerize\"   changes:     - service3\/**\/*   when: on_success   allow_failure: true - when: never   script: - apk add --no-cache bash docker - IMAGE=${CI_REGISTRY_IMAGE}\/${SERVICE} - DOCKERFILE=\"-f ${SERVICE}_service\/Dockerfile\" - docker build $DOCKERFILE -t ${IMAGE}:$IMAGE_VERSION . - docker push ${IMAGE}:$IMAGE_VERSION - echo $IMAGE:$IMAGE_VERSION &gt; IMAGE_${SERVICE}   artifacts: paths:   - IMAGE_${SERVICE}       service1:dockerize:   needs: - job: \"service1:test\"   optional: true   variables: SERVICE: service1   &lt;&lt;: *dockerize_template   service2:dockerize:   needs: - job: \"service2:test\"   optional: true   variables: SERVICE: service2   &lt;&lt;: *dockerize_template   service3:dockerize:   needs: - job: \"service3:test\"   optional: true   variables: SERVICE: service3   &lt;&lt;: *dockerize_template <\/code><\/pre>\n<p>\u041e\u00a0\u0442\u043e\u043c, \u043a\u0430\u043a\u00a0\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432, \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/docs.gitlab.com\/ci\/testing\/unit_test_reports\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Gitlab<\/a>.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u043e\u0434\u0430, \u0438 \u043e\u043d \u0434\u043e\u043a\u0430\u0437\u0430\u043b \u0441\u0432\u043e\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u00a0\u2014 2\u20133\u00a0\u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430\u00a0\u0441\u0435\u0440\u0432\u0438\u0441,<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u00a0MR, \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u044f \u043e\u0442\u00a0\u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430,<\/p>\n<\/li>\n<li>\n<p>\u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043f\u0440\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0447\u0430\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432\u044b\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0438\u0437\u00a0\u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041d\u043e\u00a0\u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u00a0\u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f\u00a0\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u00a0CI\/CD.<\/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\/889824\/\"> https:\/\/habr.com\/ru\/articles\/889824\/<\/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>\u0421\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Polymatica EPM (\u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0431\u044e\u0434\u0436\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438: \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430\u00a0\u0441\u0442\u0435\u043a\u0435 FastAPI + Poetry + Pytest. \u0418\u0437\u2011\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0435\u0441\u0442\u044b, \u0432\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435. \u0412\u0441\u0435 \u0448\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u043e\u0441\u043b\u0430, \u0442\u0435\u0441\u0442\u044b \u043f\u0438\u0441\u0430\u043b\u0438\u0441\u044c, \u043d\u043e\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u00a0\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u043c\u0438. \u041d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0433\u043e\u043d \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 Merge Request (MR).<\/p>\n<p>\u041d\u0430\u00a0\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u00a0\u043d\u0430\u0441\u00a0\u0431\u044b\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitLab \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 CI\/CD, \u043d\u043e\u00a0\u0440\u0435\u0441\u0443\u0440\u0441\u044b DevOps\u00a0\u0431\u044b\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u0441\u0438\u043b\u0430\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u0411\u043e\u0433\u0434\u0430\u043d\u043e\u0432, \u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u044d\u043a\u0435\u043d\u0434\u2011\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0438 \u0432\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a\u00a0\u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432, \u0441\u00a0\u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f\u00a0CI\/CD.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<ol>\n<li>\n<p><strong>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u00a0CI\/CD\u2011\u0432\u043e\u0440\u043a\u0435\u0440\u0435 \u0438\u043b\u0438\u00a0\u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437.<\/strong><\/p>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b: \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438, \u0437\u0430\u0433\u0440\u044f\u0437\u043d\u0435\u043d\u0438\u0435 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u00a0\u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442\u00a0\u0436\u0435 image, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u2011\u0441\u0442\u0435\u043d\u0434.<\/strong><\/p>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438\u00a0\u0441\u0431\u043e\u0440\u043a\u0435 \u0441\u0442\u0435\u043d\u0434\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u043e\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f\u00a0\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u00a0\u043e\u043f\u044f\u0442\u044c\u00a0\u0436\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435.<\/strong><\/p>\n<p>\u041c\u0438\u043d\u0443\u0441\u044b: \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u00a0\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0430\u00a0\u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043d\u043e\u0432\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u2011\u043e\u0431\u0440\u0430\u0437.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 <strong>\u0442\u0440\u0435\u0442\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/strong>, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u043b \u0431\u0430\u043b\u0430\u043d\u0441 \u043c\u0435\u0436\u0434\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<h2>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<h3>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h3>\n<pre><code> monorep\/ \u251c\u2500\u2500 service_1\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_2\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_3\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 .gitlab_ci.yml<\/code><\/pre>\n<p>monorep\/\u00a0\u2014 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<br \/>service_1\/, service_2\/, service_3\/\u00a0\u2014 \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0441\u00a0\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>Dockerfile\u00a0\u2014 \u0444\u0430\u0439\u043b \u0434\u043b\u044f\u00a0\u0441\u0431\u043e\u0440\u043a\u0438 Docker\u2011\u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<\/li>\n<li>\n<p>pyproject.toml\u00a0\u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0Poetry.<\/p>\n<\/li>\n<li>\n<p>poetry.lock\u00a0\u2014 \u0444\u0430\u0439\u043b \u0441\u00a0\u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>app\/\u00a0\u2014 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u00a0\u043a\u043e\u0434\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0442\u0443\u0442\u00a0\u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u00a0\u043a\u043e\u0440\u043d\u0435 \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f:<br \/>.gitlab_ci.yml\u00a0\u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0GitLab CI\/CD.<\/p>\n<p>\u0414\u043b\u044f\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u00a0\u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Dockerfile \u0434\u043b\u044f \u00ab\u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430\u00bb.<\/p>\n<h3>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u0443\u00a0\u2014 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u00a0\u043d\u0430\u0448\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u00a0poetry, \u0432\u00a0\u0446\u0435\u043b\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043a, \u043e\u0434\u043d\u0430\u043a\u043e\u00a0\u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 polars). \u0414\u043b\u044f\u00a0\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 requirements.txt \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">poetry export --without-hashes \u2011f requirements.txt \u2011output requirements1.txt<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e requirements.txt, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u043d\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 python:<\/p>\n<pre><code class=\"python\">import argparse from packaging.requirements import Requirement, InvalidRequirement   def parse_requirements(file_path): dependencies = {} options = set() with open(file_path, 'r') as f:     for line in f:         line = line.strip()         if not line or line.startswith('#'):             continue                  if ' -- ' in line:             dep_part, options_part = line.split(' -- ', 1)             current_options = [' -- ' + opt.strip() for opt in options_part.split(' -- ')]             options.update(current_options)         else:             dep_part = line             current_options = []          dep_part = dep_part.split(';')[0].strip()         if not dep_part:             continue          try:             req = Requirement(dep_part)             dep_name = req.name             dependencies[dep_name] = dep_part         except InvalidRequirement:             print(f\"\u26a0\ufe0f \u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430: '{dep_part}' \u0432 \u0444\u0430\u0439\u043b\u0435 {file_path} \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430.\")             continue  return dependencies, options  def main(): parser = argparse.ArgumentParser(description='\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e requirements.txt') parser.add_argument('files', nargs='+', help='\u0421\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f') parser.add_argument('-o', '--output', default='requirements_all.txt', help='\u0412\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b') args = parser.parse_args()  all_options = set() combined_deps = {} seen_files = set()  for file_path in args.files:     if file_path in seen_files:         continue     seen_files.add(file_path)          deps, opts = parse_requirements(file_path)     all_options.update(opts)          for dep_name, dep_spec in deps.items():         if dep_name in combined_deps:             print(f\"\u26a0\ufe0f \u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442: {dep_name} \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437 {file_path} ({dep_spec})\")         combined_deps[dep_name] = dep_spec  sorted_options = sorted(all_options) sorted_deps = sorted(combined_deps.items(), key=lambda x: x[0].lower())  with open(args.output, 'w') as f:     if sorted_options:         f.write('\\n'.join(sorted_options) + '\\n\\n')     for dep_name, dep_spec in sorted_deps:         f.write(f\"{dep_spec}\\n\")  print(f\"\u2705 \u0424\u0430\u0439\u043b {args.output} \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d!\")  if __name__ == '__main__': main()<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"bash\">pip install packaging python merge_requirements.py requirements1.txt requirements2.txt requirements3.txt -o requirements_all.txt<\/code><\/pre>\n<h3>\u041f\u0438\u0448\u0435\u043c Dockerfile \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430<\/h3>\n<pre><code class=\"python\">FROM python:3.10.12-slim  RUN pip install --no-cache-dir --upgrade pip  COPY .\/requirements_all.txt requirements_all.txt RUN pip install -r requirements_all.txt<\/code><\/pre>\n<h3>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h3>\n<pre><code>monorep\/ \u251c\u2500\u2500 service_1\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_2\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 service_3\/ \u2502   \u251c\u2500\u2500 app\/ \u2502   \u251c\u2500\u2500 Dockerfile \u2502   \u251c\u2500\u2500 poetry.lock \u2502   \u2514\u2500\u2500 pyproject.toml \u251c\u2500\u2500 .gitlab_ci.yml \u251c\u2500\u2500 Dockerfile_gitlab \u2514\u2500\u2500 requirements_all.txt<\/code><\/pre>\n<h2>CI \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Gitlab<\/h2>\n<p>\u0421\u0431\u043e\u0440\u043a\u0443 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433. \u0415\u0433\u043e \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0435\u0434\u043a\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u00a0\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0433\u0438 \u0434\u043b\u044f\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 MR \u0438 \u043f\u0440\u0438\u00a0\u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u0434\u043b\u044f\u00a0\u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<pre><code class=\"yaml\">image: alpine   variables:   PRETEST: pretest    stages:   - pretest   - test   - dockerize  pretest:   stage: pretest   image: alpine:latest   only: changes:   - requirements_all.txt   - Dockerfile_gitlab   script: - apk add --no-cache bash docker - IMAGE=${CI_REGISTRY_IMAGE}\/${PRETEST} - DOCKERFILE=\"-f Dockerfile_gitlab\" - docker build $DOCKERFILE -t ${IMAGE}:$IMAGE_VERSION . - docker push ${IMAGE}:$IMAGE_VERSION - docker tag ${IMAGE}:$IMAGE_VERSION ${IMAGE}:latest - docker push ${IMAGE}:latest - echo $IMAGE:$IMAGE_VERSION &gt; IMAGE_${PRETEST}   artifacts: paths:   - IMAGE_\/c{PRETEST}   when: manual   allow_failure: true   ### Test ###   .test_template: &amp;test_template   stage: test   image: ${CI_REGISTRY_IMAGE}\/${PRETEST}:latest   allow_failure: true   rules: - if: $CI_PIPELINE_SOURCE == \"merge_request_event\" &amp;&amp; $CI_JOB_NAME == \"service1:test\"   changes:     - service1\/**\/*   when: always - if: $CI_PIPELINE_SOURCE == \"merge_request_event\" &amp;&amp; $CI_JOB_NAME == \"service2:test\"   changes:     - service2\/**\/*   when: always - if: $CI_PIPELINE_SOURCE == \"merge_request_event\" &amp;&amp; $CI_JOB_NAME == \"service3:test\"   changes:     - service3\/**\/*   when: always - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service1:test\"   changes:     - service1\/**\/*   when: always - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service2:test\"   changes:     - service2\/**\/*   when: always - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service3:test\"   changes:     - service3\/**\/*   when: always - when: never   script: - cd ${SERVICE}_service - python --version - |   if [[ -f \"migrate.py\" ]]; then     python migrate.py   fi - pytest tests -vv --color yes --cov --cov-report term --cov-report xml:coverage.xml --junitxml=report.xml - cd ..   coverage: '\/(?i)total.*? (100(?:\\.0+)?\\%|[1-9]?\\d(?:\\.\\d+)?\\%)$\/'   artifacts: reports:   coverage_report:     coverage_format: cobertura     path: ${SERVICE}_service\/coverage.xml   junit: ${SERVICE}_service\/report.xml   service1:test:   variables: SERVICE: service1   &lt;&lt;: *test_template   service2:test:   variables: SERVICE: service2   &lt;&lt;: *test_template   service3:test:   variables: SERVICE: service3   &lt;&lt;: *test_template  ### Dockerize ###   .dockerize_template: &amp;dockerize_template   stage: dockerize   image: alpine:latest   rules: - if: $CI_PIPELINE_SOURCE == \"merge_request_event\"   when: never - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service1:dockerize\"   changes:     - service1\/**\/*   when: on_success   allow_failure: true - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service2:dockerize\"   changes:     - service2\/**\/*   when: on_success   allow_failure: true - if: $CI_COMMIT_REF_NAME =~ \/^(dev|stage)$\/ &amp;&amp; $CI_JOB_NAME == \"service3:dockerize\"   changes:     - service3\/**\/*   when: on_success   allow_failure: true - when: never   script: - apk add --no-cache bash docker - IMAGE=${CI_REGISTRY_IMAGE}\/${SERVICE} - DOCKERFILE=\"-f ${SERVICE}_service\/Dockerfile\" - docker build $DOCKERFILE -t ${IMAGE}:$IMAGE_VERSION . - docker push ${IMAGE}:$IMAGE_VERSION - echo $IMAGE:$IMAGE_VERSION &gt; IMAGE_${SERVICE}   artifacts: paths:   - IMAGE_${SERVICE}       service1:dockerize:   needs: - job: \"service1:test\"   optional: true   variables: SERVICE: service1   &lt;&lt;: *dockerize_template   service2:dockerize:   needs: - job: \"service2:test\"   optional: true   variables: SERVICE: service2   &lt;&lt;: *dockerize_template   service3:dockerize:   needs: - job: \"service3:test\"   optional: true   variables: SERVICE: service3   &lt;&lt;: *dockerize_template <\/code><\/pre>\n<p>\u041e\u00a0\u0442\u043e\u043c, \u043a\u0430\u043a\u00a0\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432, \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/docs.gitlab.com\/ci\/testing\/unit_test_reports\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Gitlab<\/a>.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0433\u043e\u0434\u0430, \u0438 \u043e\u043d \u0434\u043e\u043a\u0430\u0437\u0430\u043b \u0441\u0432\u043e\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u00a0\u2014 2\u20133\u00a0\u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430\u00a0\u0441\u0435\u0440\u0432\u0438\u0441,<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u0441\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u00a0MR, \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u044f \u043e\u0442\u00a0\u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430,<\/p>\n<\/li>\n<li>\n<p>\u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437<\/p>\n<\/li>\n<\/ul>\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-451517","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/451517","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=451517"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/451517\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=451517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=451517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=451517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}