{"id":4385,"date":"2025-09-11T14:57:26","date_gmt":"2025-09-11T11:57:26","guid":{"rendered":"https:\/\/cloudvps.by\/community\/?p=4385"},"modified":"2025-09-11T14:58:17","modified_gmt":"2025-09-11T11:58:17","slug":"sozdanie-ci-cd-pajplajna-s-bitbucket-vps","status":"publish","type":"post","link":"https:\/\/cloudvps.by\/community\/sozdanie-ci-cd-pajplajna-s-bitbucket-vps\/","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0441 Bitbucket + VPS: \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u043f\u043b\u043e\u044f \u043f\u043e\u2011\u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438"},"content":{"rendered":"\n<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0430\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 <a href=\"https:\/\/cloudvps.by\/servers\/vps\/vps_server.php\" data-internallinksmanager029f6b8e52c=\"4\" title=\"VPS \u0445\u043e\u0441\u0442\u0438\u043d\u0433\">VPS<\/a>, \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 <strong>Bitbucket Pipelines<\/strong>. \u041e\u043d <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>, \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/jenkins\/\" data-internallinksmanager029f6b8e52c=\"371\" title=\"Jenkins\u00a0(\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 CI\/CD \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c)\">Jenkins<\/a>, GitLab <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/continuous-integration\/\" data-internallinksmanager029f6b8e52c=\"369\" title=\"Continuous Integration (CI)\">CI<\/a> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 <strong><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> \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0427\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Bitbucket-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c\u0438 Pipelines<\/li>\n\n\n\n<li>VPS \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043f\u043e <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ssh\/\" data-internallinksmanager029f6b8e52c=\"197\" title=\"SSH (Secure Shell)\">SSH<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/docker\/\" data-internallinksmanager029f6b8e52c=\"258\" title=\"Docker\">Docker<\/a> \u0438\u043b\u0438 Nginx (\u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e)<\/li>\n\n\n\n<li>\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u0435\u043f\u043b\u043e\u044f \u0438\u043b\u0438 <code>rsync<\/code>, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445<\/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\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 pipeline?<\/h2>\n\n\n\n<p><strong>Pipeline \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0448\u0430\u0433\u043e\u0432<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u0435, \u043f\u0443\u0448\u0435 \u0438\u043b\u0438 pull-\u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 CI\/CD (Continuous Integration\/<a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/continuous-delivery\/\" data-internallinksmanager029f6b8e52c=\"370\" title=\"Continuous Delivery (CD)\">Continuous Delivery<\/a>) \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n\n\n\n<p>\u0412 Bitbucket \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 YAML-\u0444\u0430\u0439\u043b\u0435 <code>.bitbucket-pipelines.yml<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u2014 \u0437\u0430\u0434\u0430\u0442\u044c \u0448\u0430\u0433\u0438: \u0441\u0431\u043e\u0440\u043a\u0430, \u0442\u0435\u0441\u0442\u044b, \u0434\u0435\u043f\u043b\u043e\u0439, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u0442. \u0434.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041c\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 <code>.bitbucket-pipelines.yml<\/code><\/h2>\n\n\n\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e CI\/CD pipeline \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e Python + Flask \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>image: python:3.11\n\npipelines:\n  branches:\n    main:\n      - step:\n          name: Deploy to VPS\n          caches:\n            - pip\n          script:\n            - pip install -r requirements.txt\n            - scp -o StrictHostKeyChecking=no -r .\/ myuser@your.vps.<a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/ip-adres\/\" data-internallinksmanager029f6b8e52c=\"204\" title=\"IP-\u0430\u0434\u0440\u0435\u0441 (Internet Protocol)\">ip<\/a>:\/home\/myuser\/project\n            - ssh myuser@your.vps.ip 'cd \/home\/myuser\/project &amp;&amp; systemctl restart flask-app'\n<\/code><\/pre>\n\n\n\n<p>\u0417\u0434\u0435\u0441\u044c:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438,<\/li>\n\n\n\n<li>\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 VPS \u043f\u043e SSH,<\/li>\n\n\n\n<li>\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c systemd-\u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/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\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 SSH-\u0434\u043e\u0441\u0442\u0443\u043f<\/h2>\n\n\n\n<p>Bitbucket \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 <strong>\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c SSH-\u043a\u043b\u044e\u0447\u0438 \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><\/strong> \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <em>Repository Settings \u2192 Pipelines \u2192 Repository variables<\/em>. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 <code>scp<\/code> \u0438 <code>ssh<\/code> \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u044f:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0421\u043e\u0437\u0434\u0430\u044e SSH-\u043a\u043b\u044e\u0447 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -t rsa -b 4096 -C \"ci@bitbucket\"\n<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 (<code>.pub<\/code>) \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u043d\u0430 VPS \u0432 <code>~\/.ssh\/authorized_keys<\/code>.<\/li>\n\n\n\n<li>\u041f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 (<code>id_rsa<\/code>) \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u0432 Bitbucket \u043a\u0430\u043a <code>DEPLOY_KEY<\/code>.<\/li>\n\n\n\n<li>\u0412 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>script:\n  - echo \"$DEPLOY_KEY\" &gt; id_rsa\n  - chmod 600 id_rsa\n  - ssh -i id_rsa ...\n<\/code><\/pre>\n\n\n\n<p>\u0422\u0435\u043f\u0435\u0440\u044c <strong>\u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d<\/strong>, \u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u2014 \u0437\u0430\u0449\u0438\u0449\u0451\u043d.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u0414\u0435\u043f\u043b\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 Docker<\/h2>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d \u0432 Docker, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0438\u0449\u0435. \u042f \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0443\u0448\u0443 \u043e\u0431\u0440\u0430\u0437 \u0432 Docker Hub, \u0430 VPS \u0442\u044f\u043d\u0435\u0442 \u0435\u0433\u043e \u0441\u0430\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pipelines:\n  default:\n    - step:\n        name: Build and Push Docker Image\n        script:\n          - docker build -t mydockerhubuser\/myproject:latest .\n          - echo \"$DOCKER_PASSWORD\" | docker login -u \"$DOCKER_USERNAME\" --password-stdin\n          - docker push mydockerhubuser\/myproject:latest\n<\/code><\/pre>\n\n\n\n<p>\u0410 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker pull mydockerhubuser\/myproject:latest\ndocker compose up -d\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041d\u044e\u0430\u043d\u0441\u044b \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430<\/h2>\n\n\n\n<p>Bitbucket Pipelines \u0443\u043c\u0435\u0435\u0442:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0434\u0435\u043b\u0430\u0442\u044c <strong>\u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u043f\u043e \u0432\u0435\u0442\u043a\u0430\u043c<\/strong> (<code>main<\/code>, <code>dev<\/code>, <code>release<\/code>);<\/li>\n\n\n\n<li>\u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e;<\/li>\n\n\n\n<li>\u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 <strong>Slack \/ Telegram<\/strong> \u0447\u0435\u0440\u0435\u0437 webhook;<\/li>\n\n\n\n<li>\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/li>\n<\/ul>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c <strong>startLimitBurst<\/strong>, <code>restart=on-failure<\/code>, <code>RestartSec=5s<\/code> \u0432 <code>systemd<\/code>, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0441\u0430\u043c \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 (\u0441\u043c. <a>\u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e auto-healing \u0441 systemd<\/a>).<\/p>\n\n\n\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0412\u043e\u0442 <strong>\u0427\u0430\u0441\u0442\u044c 3\/3<\/strong> \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0442\u0435\u043c\u0435 <strong>\u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0441 Bitbucket + VPS\u00bb<\/strong> \u2014 \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u0430\u044f, \u0441 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u043c\u0438 \u0438 SEO-\u0431\u043b\u043e\u043a\u043e\u043c.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 CI\/CD \u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043a\u0430\u0442\u043e\u0432<\/h2>\n\n\n\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0433\u043e\u0442\u043e\u0432, \u0432\u0430\u0436\u043d\u043e <strong>\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u043d\u0438\u043c<\/strong>: \u0432\u0434\u0440\u0443\u0433 \u043e\u0434\u0438\u043d \u0438\u0437 \u0448\u0430\u0433\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/api\/\" data-internallinksmanager029f6b8e52c=\"226\" title=\"API (Application Programming Interface)\">API<\/a>, \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e <code>timeout<\/code>.<\/p>\n\n\n\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Telegram-\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u043c\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>- curl -X POST <a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/https\/\" data-internallinksmanager029f6b8e52c=\"221\" title=\"HTTPS (Hyper Text Transfer Protocol Secure)\">https<\/a>:\/\/api.telegram.org\/bot$TG_TOKEN\/sendMessage \\\n  -d chat_id=$TG_CHAT_ID \\\n  -d text=\" \u0414\u0435\u043f\u043b\u043e\u0439 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d \u043d\u0430 $BITBUCKET_BRANCH\"\n<\/code><\/pre>\n\n\n\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u044d\u0442\u043e \u0432 <code>after-script<\/code>, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u0442\u044c, <strong>\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u0441\u0451 \u0443\u043f\u0430\u043b\u043e<\/strong>.<\/p>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>fail2ban<\/strong> \u2014 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 IP \u043f\u0440\u0438 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438;<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/cloudvps.by\/community\/docs\/glossarij\/terminy\/uptime\/\" data-internallinksmanager029f6b8e52c=\"232\" title=\"Uptime (\u0410\u043f\u0442\u0430\u0439\u043c)\">Uptime<\/a> Kuma<\/strong> \u2014 \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u0430\u0439\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d;<\/li>\n\n\n\n<li><strong>systemd<\/strong> \u0441 <code>Restart=on-failure<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0430\u0434\u0430\u043b\u043e \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430.<\/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\">\u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435 Bitbucket Pipelines<\/h2>\n\n\n\n<p>Bitbucket \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 CI\/CD, \u043d\u043e \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0442\u0430\u0440\u0438\u0444 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d 50 \u043c\u0438\u043d\u0443\u0442\u0430\u043c\u0438 \u0432 \u043c\u0435\u0441\u044f\u0446 (\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432);<\/li>\n\n\n\n<li>\u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b.<\/li>\n<\/ul>\n\n\n\n<p>\u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 <strong>GitHub Actions<\/strong> (\u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432);<\/li>\n\n\n\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>GitLab CI<\/strong> \u2014 \u0442\u0430\u043c \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u043e\u043c: git + CI\/CD + registry.<\/li>\n<\/ul>\n\n\n\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 Bitbucket Pipelines, \u043a\u043e\u0433\u0434\u0430:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u044b\u043b <strong>\u043d\u0430 Flask \u0438\u043b\u0438 Laravel<\/strong>, \u0441 \u043e\u0434\u043d\u0438\u043c VPS;<\/li>\n\n\n\n<li>\u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b <strong>\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433<\/strong>;<\/li>\n\n\n\n<li>\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c <strong>\u043d\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f<\/strong> \u043d\u0430 Jenkins \u0438 \u0442.\u0434.<\/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\">\u0427\u0442\u043e \u044f \u0434\u0443\u043c\u0430\u044e&#8230;<\/h2>\n\n\n\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 Bitbucket \u0438 VPS \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u0442\u0440\u0430\u0448\u043d\u043e, \u043a\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f. \u041d\u0443\u0436\u043d\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432\u0441\u0451 \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0434\u0451\u0442 <strong>\u0432 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435<\/strong>: \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u00ab\u0437\u0430\u0445\u043e\u0434\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438 \u0440\u0443\u043a\u0430\u043c\u0438\u00bb, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u00ab\u043e\u0439, \u0437\u0430\u0431\u044b\u043b\u0430 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c .env\u00bb.<\/p>\n\n\n\n<p>\u041d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u043f\u0443\u0448\u0443 \u043a\u043e\u0434 \u2192 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442 \u2192 Telegram \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0435\u0442 \u2192 \u0441\u0430\u0439\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d.<\/li>\n<\/ul>\n\n\n\n<p>\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438? \u041a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u0430\u044f.<br>\u041e\u0448\u0438\u0431\u043e\u043a? \u041f\u043e\u0447\u0442\u0438 \u043d\u0435\u0442.<br>\u041f\u043e\u043a\u043e\u0439? \u041f\u043e\u0447\u0442\u0438 \u0434\u0437\u0435\u043d \ud83d\ude0c<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u0433\u0434\u0430 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0430\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 VPS, \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 Bitbucket Pipelines. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Jenkins, GitLab CI \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u0427\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e: \u0427\u0442\u043e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-4385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-avtomatizacziya"],"_links":{"self":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4385","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=4385"}],"version-history":[{"count":2,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4385\/revisions"}],"predecessor-version":[{"id":4389,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/posts\/4385\/revisions\/4389"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media\/4386"}],"wp:attachment":[{"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/media?parent=4385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/categories?post=4385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudvps.by\/community\/wp-json\/wp\/v2\/tags?post=4385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}