{"id":4179,"date":"2025-07-11T19:15:16","date_gmt":"2025-07-11T16:15:16","guid":{"rendered":"https:\/\/cloudvps.by\/community\/?p=4179"},"modified":"2025-07-17T03:18:23","modified_gmt":"2025-07-17T00:18:23","slug":"kak-organizovat-staging-okruzhenie-na-vps-moj-opyt-i-sovety","status":"publish","type":"post","link":"https:\/\/cloudvps.by\/community\/kak-organizovat-staging-okruzhenie-na-vps-moj-opyt-i-sovety\/","title":{"rendered":"\u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c staging-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 VPS \u2014 \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0438 \u0441\u043e\u0432\u0435\u0442\u044b"},"content":{"rendered":"\n<p>\u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u044f \u043f\u0440\u0438\u0448\u043b\u0430 \u043a \u0438\u0434\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c staging \u043d\u0435 \u0441\u0440\u0430\u0437\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u0451 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u201c\u0432 \u043f\u0440\u043e\u0434\u0435\u201d (\u0434\u0430-\u0434\u0430, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u201c\u0436\u0430\u0440\u0435\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u201d), \u0430 \u043f\u043e\u0442\u043e\u043c \u2014 \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0441\u0430\u0439\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0446\u0435\u043b\u044b\u0435 \u0441\u0443\u0442\u043a\u0438 \u2014 \u043f\u043e\u043d\u044f\u043b\u0430, \u0447\u0442\u043e \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u043b\u044c\u0437\u044f. \u0418 \u0432\u043e\u0442 \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 staging \u0441\u0442\u0430\u043b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0427\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435 staging?<\/h3>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e-\u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443, staging \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 (dev) \u0438 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u043e\u043c (prod), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <strong>\u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u201c\u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u043a \u0432 \u0431\u043e\u044e\u201d<\/strong>, \u043d\u043e \u0431\u0435\u0437 \u0440\u0438\u0441\u043a\u0430 \u0432\u0441\u0451 \u0441\u043b\u043e\u043c\u0430\u0442\u044c.<\/p>\n\n\n\n<p>\u0423\u0441\u043b\u043e\u0432\u043d\u043e \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dev \u2192 Staging \u2192 Prod\n<\/code><\/pre>\n\n\n\n<p>\u0412 staging-\u0441\u0440\u0435\u0434\u0435 \u043a\u043e\u0434 \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d, \u0431\u0430\u0437\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u201c\u0431\u043e\u0435\u0432\u043e\u0433\u043e\u201d \u0441\u0430\u0439\u0442\u0430. \u042d\u0442\u043e \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u043f\u0435\u0442\u0438\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0435\u043c\u044c\u0435\u0440\u043e\u0439. \u0412\u0441\u0451 \u0432\u0438\u0434\u043d\u043e, \u0432\u0441\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0449\u0443\u043f\u0430\u0442\u044c, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0431\u0435\u0437 \u0437\u0440\u0438\u0442\u0435\u043b\u0435\u0439.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0417\u0430\u0447\u0435\u043c \u043e\u043d \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0443\u0436\u0435\u043d?<\/h3>\n\n\n\n<p>\u041d\u0430 \u0441\u0432\u043e\u0451\u043c \u043e\u043f\u044b\u0442\u0435 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c: staging-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0441\u043f\u0430\u0441\u0430\u043b\u043e \u043c\u043d\u0435 \u0438 \u043d\u0435\u0440\u0432\u044b, \u0438 \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044e.<\/p>\n\n\n\n<p>\u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041e\u0434\u0438\u043d \u0440\u0430\u0437 staging \u043f\u043e\u043c\u043e\u0433 \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u043c \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u2014 \u0432 \u043f\u0440\u043e\u0434\u0435 \u043e\u043d \u0431\u044b \u0443\u043b\u0435\u0442\u0435\u043b \u0432 \u043b\u0438\u0446\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/li>\n\n\n\n<li>\u0412 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437 staging \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435\u0439 \u0434\u043b\u044f \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e &#8220;\u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f&#8221; \u0441 CSS \u0431\u0435\u0437 \u0441\u0442\u0440\u0430\u0445\u0430 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0430\u0439\u0442.<\/li>\n\n\n\n<li>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, staging \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c <strong>\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 workflow \u0441 \u0434\u0435\u043f\u043b\u043e\u044f\u043c\u0438<\/strong> \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0448\u044c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0438\u043b\u0438 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f staging-\u0441\u0440\u0435\u0434\u044b?<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/cloudvps.by\/servers\/vps\/vps_server.php\" data-internallinksmanager029f6b8e52c=\"4\" title=\"VPS \u0445\u043e\u0441\u0442\u0438\u043d\u0433\">VPS<\/a> (\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442 production, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0430 \u0442\u043e\u043c \u0436\u0435, \u0435\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0445\u0432\u0430\u0442\u0430\u0435\u0442);<\/li>\n\n\n\n<li><a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/docker\/\" data-internallinksmanager029f6b8e52c=\"258\" title=\"Docker\">Docker<\/a> (\u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d, \u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443);<\/li>\n\n\n\n<li>Git + <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/gitlab-ci-cd\/\" data-internallinksmanager029f6b8e52c=\"372\" title=\"GitLab CI\/CD (\u041d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0430 \u0432 GitLab)\">CI\/CD<\/a> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, GitHub Actions, GitLab CI \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/downtime\/\" data-internallinksmanager029f6b8e52c=\"233\" title=\"Downtime (\u0412\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u044f)\">\u043f\u0440\u043e\u0441\u0442\u043e\u0439<\/a> shell-\u0441\u043a\u0440\u0438\u043f\u0442);<\/li>\n\n\n\n<li>\u0423\u043c\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: <code>.env<\/code>, \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0442.\u0434.;<\/li>\n\n\n\n<li>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u044b \u2014 \u043d\u043e \u043e\u043d\u043e \u0442\u043e\u0433\u043e \u0441\u0442\u043e\u0438\u0442!<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 staging \u0441 \u043d\u0443\u043b\u044f: \u043c\u043e\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434<\/h3>\n\n\n\n<p>\u042f \u043b\u044e\u0431\u043b\u044e \u0434\u0435\u0440\u0436\u0430\u0442\u044c <strong>staging \u0438 production \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438<\/strong>. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u0434\u0438\u043d VPS, \u0441\u043e\u0437\u0434\u0430\u044e \u0434\u0432\u0435 \u043f\u0430\u043f\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/var\/www\/project-prod\n\/var\/www\/project-staging\n<\/code><\/pre>\n\n\n\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c <code>nginx<\/code>-\u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u043e\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u043b\u043e\u0433\u0430\u043c\u0438. \u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u0432\u043e\u0436\u0443 \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u0443 \u043a\u0443\u0447\u0443 \u2014 \u0438\u043d\u0430\u0447\u0435 staging \u0442\u0435\u0440\u044f\u0435\u0442 \u0441\u043c\u044b\u0441\u043b.<\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439, staging \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e \u043d\u0430 <strong>\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c VPS<\/strong>, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0432\u0430\u0436\u043d\u043e \u201c\u0432\u0438\u0434\u0435\u0442\u044c\u201d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n\n\n\n<p>\u0421\u0440\u0430\u0437\u0443 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>project_staging_db\n<\/code><\/pre>\n\n\n\n<p>\u0418 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 \u043a \u043d\u0435\u0439 staging-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e <strong>\u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0441 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430<\/strong> \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump -u <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/root-dostup\/\" data-internallinksmanager029f6b8e52c=\"234\" title=\"Root-\u0434\u043e\u0441\u0442\u0443\u043f\">root<\/a> -p project_prod_db &gt; dump.sql\nmysql -u root -p project_staging_db &lt; dump.sql\n<\/code><\/pre>\n\n\n\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c e-mail \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/token-based-authentication\/\" data-internallinksmanager029f6b8e52c=\"311\" title=\"Token-based Authentication\">\u0442\u043e\u043a\u0435\u043d\u044b<\/a>, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0436\u0438\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f nginx \u0434\u043b\u044f staging<\/h3>\n\n\n\n<p>\u0412\u043e\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 <code>nginx<\/code>-\u043a\u043e\u043d\u0444\u0438\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n    server_name staging.example.com;\n\n    root \/var\/www\/project-staging\/public;\n\n    index index.html index.php;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$query_string;\n    }\n\n    location ~ \\.php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/var\/run\/php\/php8.1-fpm.sock;\n    }\n\n    access_log \/var\/log\/nginx\/staging.access.log;\n    error_log \/var\/log\/nginx\/staging.error.log;\n}\n<\/code><\/pre>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ssl\/\" data-internallinksmanager029f6b8e52c=\"219\" title=\"SSL (Secure Sockets Layer)\">SSL<\/a> \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/lets-encrypt\/\" data-internallinksmanager029f6b8e52c=\"319\" title=\"Let\u2019s Encrypt\">Let&#8217;s Encrypt<\/a>. \u041d\u043e \u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0435\u0441\u043b\u0438 staging \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u0435\u0431\u044f.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e \u0437\u0430\u0449\u0438\u0442\u0443<\/h3>\n\n\n\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 staging \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e HTTP Basic Auth:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install apache2-utils\nhtpasswd -c \/etc\/nginx\/.htpasswd user\n<\/code><\/pre>\n\n\n\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 <code>nginx<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>auth_basic \"Restricted\";\nauth_basic_user_file \/etc\/nginx\/.htpasswd;\n<\/code><\/pre>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 <code>robots.txt<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>User-agent: *\nDisallow: \/\n<\/code><\/pre>\n\n\n\n<p>\u0418 \u0434\u0430\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e <code>noindex<\/code> \u0432 <code>&lt;head&gt;<\/code> \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">CI\/CD: \u043a\u0430\u043a \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0432 staging \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/h2>\n\n\n\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e GitHub Actions. \u0412\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>.github\/workflows\/staging.yml<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>name: Deploy to Staging\n\non:\n  push:\n    branches:\n      - develop\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions\/checkout@v2\n\n      - name: Deploy via <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ssh\/\" data-internallinksmanager029f6b8e52c=\"197\" title=\"SSH (Secure Shell)\">SSH<\/a>\n        uses: appleboy\/ssh-action@v0.1.2\n        with:\n          host: ${{ secrets.STAGING_HOST }}\n          username: ${{ secrets.STAGING_USER }}\n          key: ${{ secrets.STAGING_SSH_KEY }}\n          script: |\n            cd \/var\/www\/project-staging\n            git pull origin develop\n            php artisan migrate --force\n<\/code><\/pre>\n\n\n\n<p>\u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 <code>push<\/code> \u0432 <code>develop<\/code> \u0443 \u043c\u0435\u043d\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f staging. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043d\u0435 \u043f\u0443\u0442\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0441 <code>main<\/code> \u0438\u043b\u0438 <code>prod<\/code> \u0432\u0435\u0442\u043a\u0430\u043c\u0438!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u0430\u043a \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c staging \u043e\u0442 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430?<\/h2>\n\n\n\n<p>\u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e! \u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 staging \u043a\u043e\u043f\u0438\u0435\u0439 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430 \u201c\u0432 \u043b\u0438\u0446\u043e\u201d.<\/p>\n\n\n\n<p>\u0412\u043e\u0442 \u043c\u043e\u0438 \u043f\u0440\u0438\u0451\u043c\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0421\u0442\u0430\u0432\u043b\u044e <strong>\u0431\u0430\u043d\u043d\u0435\u0440<\/strong> \u201c\u0412\u044b \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438\u201d \u0441\u0432\u0435\u0440\u0445\u0443;<\/li>\n\n\n\n<li>\u041c\u0435\u043d\u044f\u044e \u0446\u0432\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0430 \u0438\u043b\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430;<\/li>\n\n\n\n<li>\u041f\u043e\u0434\u043c\u0435\u043d\u044f\u044e e-mail \u043d\u0430 <code>@staging.local<\/code>;<\/li>\n\n\n\n<li>\u0412 \u0444\u0443\u0442\u0435\u0440\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0434\u0430\u0442\u0443 \u0431\u0438\u043b\u0434\u0430.<\/li>\n<\/ul>\n\n\n\n<p>\u0411\u044b\u0432\u0430\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u0443\u0442\u0430\u043b\u0438 staging \u0438 \u043f\u0438\u0441\u0430\u043b\u0438 &#8220;\u0430 \u0433\u0434\u0435 \u043c\u043e\u0438 \u0437\u0430\u043a\u0430\u0437\u044b?&#8221; \u2014 \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u0434\u0435\u043b\u0430\u044e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u044f\u0432\u043d\u043e.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0427\u0442\u043e \u041d\u0415 \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0432 staging<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u041d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 \u0431\u043e\u0435\u0432\u044b\u0435 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/api\/\" data-internallinksmanager029f6b8e52c=\"226\" title=\"API (Application Programming Interface)\">API<\/a>-\u043a\u043b\u044e\u0447\u0438.<\/strong> \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043b\u0430\u0442\u0451\u0436\u043a\u0438 \u2014 \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442, \u0438 \u0432\u044b \u0443\u043b\u0435\u0442\u0438\u0442\u0435 \u0432 \u043c\u0438\u043d\u0443\u0441.<\/li>\n\n\n\n<li><strong>\u041d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0439\u0442\u0435 \u043b\u043e\u0433\u0438\u043a\u0443 \u0441 production.<\/strong> \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0431\u0449\u0438\u0445 cron-\u0437\u0430\u0434\u0430\u0447 \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439.<\/li>\n\n\n\n<li><strong>\u041d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 staging \u0432\u0441\u0435\u043c\u0443 \u043c\u0438\u0440\u0443.<\/strong> \u041e\u043d \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u041d\u0430 \u0441\u0432\u043e\u0451\u043c \u043e\u043f\u044b\u0442\u0435 \u0441\u043a\u0430\u0436\u0443: staging \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0442\u044c, \u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u201c\u043f\u043e-\u0432\u0437\u0440\u043e\u0441\u043b\u043e\u043c\u0443\u201d. \u041f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043e\u0434\u0438\u043d, staging \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u0447\u0438 \u0434\u043e \u0440\u0435\u043b\u0438\u0437\u0430;<\/li>\n\n\n\n<li>\u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c UI \u0431\u0435\u0437 \u0441\u0442\u0440\u0430\u0445\u0430 \u0432\u0441\u0451 \u0441\u043b\u043e\u043c\u0430\u0442\u044c;<\/li>\n\n\n\n<li>\u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443.<\/li>\n<\/ul>\n\n\n\n<p>\u0418 \u043f\u0443\u0441\u0442\u044c \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u201c\u044d\u0442\u043e \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435\u201d, \u043d\u043e \u043e\u0434\u0438\u043d \u0444\u0435\u0439\u043b \u0432 \u043f\u0440\u043e\u0434\u0435 \u2014 \u0438 \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u0434\u044b.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u044f \u043f\u0440\u0438\u0448\u043b\u0430 \u043a \u0438\u0434\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c staging \u043d\u0435 \u0441\u0440\u0430\u0437\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u0451 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u201c\u0432 \u043f\u0440\u043e\u0434\u0435\u201d (\u0434\u0430-\u0434\u0430, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u201c\u0436\u0430\u0440\u0435\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u201d), \u0430 \u043f\u043e\u0442\u043e\u043c \u2014 \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0441\u0430\u0439\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u0446\u0435\u043b\u044b\u0435 \u0441\u0443\u0442\u043a\u0438 \u2014 \u043f\u043e\u043d\u044f\u043b\u0430, \u0447\u0442\u043e \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u043b\u044c\u0437\u044f. \u0418 \u0432\u043e\u0442 \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 staging \u0441\u0442\u0430\u043b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4192,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-4179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gajdy"],"_links":{"self":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/comments?post=4179"}],"version-history":[{"count":1,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4179\/revisions"}],"predecessor-version":[{"id":4181,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4179\/revisions\/4181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media\/4192"}],"wp:attachment":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media?parent=4179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/categories?post=4179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/tags?post=4179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}