{"id":315962,"date":"2021-01-04T21:00:26","date_gmt":"2021-01-04T21:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315962"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315962","title":{"rendered":"CI\/CD \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 GitHub \u0441 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430 AWS\u00a0EC2"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0418\u043c\u0435\u0435\u043c: \u043f\u0440\u043e\u0435\u043a\u0442 web API \u043d\u0430&nbsp;.net core \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0432 GitHub. <\/p>\n<p>\u0425\u043e\u0442\u0438\u043c: \u0430\u0432\u0442\u043e\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0435 AWS EC2 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u0434\u043e\u043c (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 push \u0432 develop \u0432\u0435\u0442\u043a\u0443). <\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: GitHub Actions, AWS CodeDeploy, S3, EC2. <\/p>\n<p>\u041d\u0438\u0436\u0435 flow \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u0433\u043d\u0430\u043b\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f43\/977\/7a2\/f439777a213c0e76f80c71f9b01a1289.jpg\" alt=\"Basic CI\/CD&nbsp;flow\" title=\"Basic CI\/CD&nbsp;flow\" width=\"2174\" height=\"459\"><figcaption>Basic CI\/CD&nbsp;flow<\/figcaption><\/figure>\n<h3>1. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438 \u0440\u043e\u043b\u0438<\/h3>\n<h4>1.1. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a AWS \u0438\u0437 GitHub Action<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a AWS \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c S3 \u0438 CodeDeploy \u0447\u0435\u0440\u0435\u0437 AWS CLI 2 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 GitHub Actions. <\/p>\n<p>1. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS IAM, \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e User, \u0438 Add User <\/p>\n<p>2. \u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 Programmatic access<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/17e\/a74\/a78\/17ea74a7849c3004d7bdf61071f7487c.PNG\" alt=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\" title=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\" width=\"984\" height=\"386\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/figcaption><\/figure>\n<p>3.  \u0414\u0430\u043b\u0435\u0435, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Permissions \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Attach existing policies directly \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 AmazonS3FullAccess \u0438 AWSCodeDeployDeployerAccess.<\/p>\n<p>4. \u0422\u044d\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 Review \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ed\/325\/7d7\/4ed3257d7b8b4a76d7ca8b5fe5566127.png\" alt=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" title=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\" width=\"541\" height=\"358\"><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p>5. \u0416\u043c\u0435\u043c Create user \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443 \u0441\u0435\u0431\u044f. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f Access Key ID \u0438 Secret Access Key \u043f\u043e\u0437\u0434\u043d\u0435\u0435.<\/p>\n<h4>1.2. \u0421\u0435\u0440\u0432\u0438\u0441\u043d\u0430\u044f \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 AWS EC2<\/h4>\n<p>\u0420\u043e\u043b\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b EC2, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c AWS CodeDeploy.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS IAM, \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e Role, \u0438 Add Role<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c AWS Service, \u0432 Choose a use case \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c EC2 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 AmazonEC2RoleforAWSCodeDeploy.<\/p>\n<\/li>\n<li>\n<p>\u0422\u044d\u0433\u0438 \u0438 Review \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ProjectXCodeDeployInstanceRole \u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 Review \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c7e\/5b8\/51a\/c7e5b851a4b57310fa9db042eef7d6ac.png\" width=\"795\" height=\"297\"><figcaption><\/figcaption><\/figure>\n<h4>1.3. \u0421\u0435\u0440\u0432\u0438\u0441\u043d\u0430\u044f \u0440\u043e\u043b\u044c \u0434\u043b\u044f AWS CodeDeploy<\/h4>\n<p>\u0420\u043e\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0443 AWS CodeDeploy \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c AWS EC2. <\/p>\n<p>1. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS IAM, \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e Role, \u0438 Add Role <\/p>\n<p>2. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c AWS Service, \u0432 Use case \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c CodeDeploy:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ed\/e04\/ea0\/1ede04ea019920fc0b4324d993c393e1.png\" alt=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0438\" title=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0438\" width=\"800\" height=\"347\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0438<\/figcaption><\/figure>\n<p>3. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435, \u043d\u0443\u0436\u043d\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043d\u0430\u043c \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c (AWSCodeDeployRole)<\/p>\n<p>4. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ProjectXCodeDeploy \u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 Review \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ce\/97d\/192\/5ce97d192df31b9c554da243b8061333.png\" alt=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u043e\u043b\u0438\" title=\"\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u043e\u043b\u0438\" width=\"773\" height=\"299\"><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u043e\u043b\u0438<\/figcaption><\/figure>\n<h3>2. \u0418\u043d\u0441\u0442\u0430\u043d\u0441 AWS&nbsp;EC2<\/h3>\n<ol>\n<li>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0432 AWS EC2 <\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0435\u043c\u0443 \u0440\u043e\u043b\u044c ProjectXCodeDeployInstanceRole, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 1.2 <\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c CodeDeploy Agent \u043d\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/codedeploy-agent-operations-install.html\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0412\u0430\u0436\u043d\u043e<\/strong>: \u0415\u0441\u043b\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0443 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u0432\u0435\u0441\u0438\u043b\u0438 \u0440\u043e\u043b\u044c, \u0442\u043e \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>sudo service codedeploy-agent restart<\/code><\/p>\n<h3>3. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f AWS CodeDeploy<\/h3>\n<p>1. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS CodeDeploy <\/p>\n<p>2. \u0421\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e \u043a\u043b\u0438\u043a\u0430\u0435\u043c Deploy, \u0432\u043d\u0443\u0442\u0440\u0438 Applications <\/p>\n<p>3. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u043a\u043d\u0443\u0432 Create application <\/p>\n<p>4. \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, projectx \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Compute platform EC2\/On-Premises<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b5\/a77\/5ff\/5b5a775ff5987e89557daca8ab4e8b18.png\" alt=\"\u041d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\" title=\"\u041d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\" width=\"583\" height=\"189\"><figcaption>\u041d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/figcaption><\/figure>\n<p>5. \u0414\u0430\u043b\u0435\u0435, \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Create deployment group<\/p>\n<p>6. \u041d\u0430\u0437\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e, develop \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0420\u043e\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0443, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 1.3 \u0432\u044b\u0448\u0435 (ProjectXCodeDeploy).<\/p>\n<p>7. Deployment type \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c In place (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442).<\/p>\n<p>8. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Environment configuration \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Amazon EC2 Instances \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u044d\u0433\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b.<\/p>\n<h3>4. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0430\u043a\u0435\u0442 \u043d\u0430 AWS&nbsp;S3<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0431\u0430\u043a\u0435\u0442 \u0432 AWS S3.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS S3, \u043a\u043b\u0438\u043a\u0430\u0435\u043c Create bucket.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, projectx-codedeploy-deployments. \u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0433\u0430\u043b\u043e\u0447\u043a\u0430 Block all public access. \u0418 \u043f\u043e\u0441\u043b\u0435 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Create bucket.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5b7\/236\/7fc\/5b72367fc94c6c8c79ae2cb9b10931bb.png\" alt=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430 S3\" title=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430 S3\" width=\"800\" height=\"576\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430 S3<\/figcaption><\/figure>\n<h3>5. \u0421\u043e\u0437\u0434\u0430\u0435\u043c appspec.yml<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b CodeDeploy Agent \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0435\u043c\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u0412 AWS CodeDeploy \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0440\u043d\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c appspec.yml. \u0412 \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0435 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">version: 0.0 os: linux files:   - source: \/     destination: \/opt\/projectx permissions:   - object: \/opt\/projectx     owner: ubuntu     group: ubuntu     type:       - directory       - file hooks:   ApplicationStart:     - location: scripts\/start_server.sh       timeout: 300       runas: ubuntu   ApplicationStop:     - location: scripts\/stop_server.sh       timeout: 300       runas: ubuntu<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<\/li>\n<li>\n<\/li>\n<li>\n<\/li>\n<li>\n<p> &nbsp;  <\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c appspec.yml  version: 0.0 os: linux files:<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c, \u0433\u0434\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 (\u0441\u0442\u0440\u043e\u043a\u0430 4), \u043a\u0443\u0434\u0430 \u0438\u0445 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c (\u0441\u0442\u0440\u043e\u043a\u0430 5) \u0438 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 (\u0441\u0442\u0440\u043e\u043a\u0438 6-12). \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0445\u0443\u043a\u043e\u0432 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u0430\u043a \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438 \u0445\u0443\u043a\u0430\u043c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/reference-appspec-file.html?appspec-reference-server\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p><strong>\u0412\u0430\u0436\u043d\u043e:<\/strong><em> <\/em>\u0412\u0435\u0440\u0441\u0438\u044e \u043d\u0430\u0434\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c 0.0, \u0442.\u043a. \u0438\u043d\u0430\u0447\u0435 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f CodeDeploy \u0438 \u0432 \u0432\u0435\u0431-\u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e <u>0.0<\/u> \u00af\\_(\u30c4)\/\u00af. \u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0434\u0435\u043f\u043b\u043e\u0439\u043c\u0435\u043d\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u043d\u0442\u0438\u0442\u044c \u0445\u0443\u043a ApplicationStop, \u0438\u043d\u0430\u0447\u0435 \u043d\u0430 \u043d\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u0421\u0432\u044f\u0437\u0430\u043d\u043e \u044d\u0442\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0430\u0433\u0435\u043d\u0442 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0449\u0435 \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0412\u0442\u043e\u0440\u043e\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 ApplicationStop \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<h3>6. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c GitHub&nbsp;Actions<\/h3>\n<p>\u041f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c CI\/CD pipeline \u043d\u0430 \u0431\u0430\u0437\u0435 GitHub Actions.<\/p>\n<h4>6.1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h4>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 GitHub \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Settings, \u0434\u0430\u043b\u0435\u0435 \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 Secrets \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>AWS_ACCESS_KEY_ID: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 5 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 1.1 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a AWS<\/p>\n<\/li>\n<li>\n<p>AWS_SECRET_ACCESS_KEY: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 5 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 1.1 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a AWS<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/765\/fc7\/d08\/765fc7d080d403981779879467a7a53b.png\" width=\"897\" height=\"499\"><figcaption><\/figcaption><\/figure>\n<h4>6.2. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>.github\/workflows<\/code>. \u0412 \u043d\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0438 \u0444\u0430\u0439\u043b\u044b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c pipeline&#8217;\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, develop.yaml. \u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<pre><code class=\"bash\">name: build-app-action on:    push:     branches:       - develop jobs:   build:     name: CI part     runs-on: ubuntu-latest     steps:       - uses: actions\/checkout@v2       - name: Setup .NET Core         uses: actions\/setup-dotnet@v1         with:           dotnet-version: 5.0.101       - name: Install dependencies         run: dotnet restore       - name: Build         run: dotnet build --configuration Release --no-restore      deploy:     name: CD part     runs-on: ubuntu-latest     strategy:       matrix:         app-name: ['projectx']         s3-bucket: ['projectx-codedeploy-deployments']         s3-filename: ['develop-aws-codedeploy-${{ github.sha }}']         deploy-group: ['develop']     needs: build     steps:       - uses: actions\/checkout@v2       # set up .net core       - name: Setup .NET Core         uses: actions\/setup-dotnet@v1         with:           dotnet-version: 5.0.101       # restore packages and build       - name: Install dependencies         run: dotnet restore       - name: Build         run: dotnet build ProjectX --configuration Release --no-restore -o .\/bin\/app       # copying appspec file       - name: Copying appspec.yml         run: cp appspec.yml .\/bin\/app       # copying scripts       - name: Copying scripts         run: cp -R .\/scripts .\/bin\/app\/scripts              # Install AWS CLI 2       - name: Install AWS CLI 2         run: |           curl \"https:\/\/awscli.amazonaws.com\/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"           unzip awscliv2.zip           sudo .\/aws\/install       # Configure AWS credentials       - name: Configure AWS Credentials         uses: aws-actions\/configure-aws-credentials@v1         with:           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}           aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}           aws-region: ap-south-1       # Deploy push to S3       - name: AWS Deploy push         run: |           aws deploy push \\           --application-name ${{ matrix.app-name }} \\           --description \"Revision of the ${{ matrix.appname }}-${{ github.sha }}\" \\           --ignore-hidden-files \\           --s3-location s3:\/\/${{ matrix.s3-bucket }}\/${{ matrix.s3-filename }}.zip \\           --source .\/bin\/app       # Creating deployment via CodeDeploy       - name: Creating AWS Deployment         run: |           aws deploy create-deployment \\           --application-name ${{ matrix.app-name }} \\           --deployment-config-name CodeDeployDefault.AllAtOnce \\           --deployment-group-name ${{ matrix.deploy-group }} \\           --file-exists-behavior OVERWRITE \\           --s3-location bucket=${{ matrix.s3-bucket }},key=${{ matrix.s3-filename }}.zip,bundleType=zip \\<\/code><\/pre>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0443 \u043d\u0430\u0441 \u0434\u0432\u0430 \u0434\u0436\u043e\u0431\u0430: \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0433\u043e (\u0440\u0430\u0437\u0434\u0435\u043b needs \u0432 deploy, \u0441\u0442\u0440\u043e\u043a\u0430 31). \u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043d\u0430 push \u0432 \u0432\u0435\u0442\u043a\u0443 develop (\u0441\u0442\u0440\u043e\u043a\u0438 2-5). <\/p>\n<p><strong>\u0428\u0430\u0433 build<\/strong><\/p>\n<p>\u041c\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c&nbsp;.net, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 11-19. \u0421\u0431\u043e\u0440\u043a\u0443 \u043c\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u043d\u0430 Ubuntu (\u0441\u0442\u0440\u043e\u043a\u0438 9 \u0438 23) \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c unit-\u0442\u0435\u0441\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0448\u0430\u0433\u0443 deploy. <\/p>\n<p><strong>\u0428\u0430\u0433 deploy<\/strong><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0442\u0438\u043f\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438. <\/p>\n<ul>\n<li>\n<p>app-name: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 4 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 3 \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CodeDeploy <\/p>\n<\/li>\n<li>\n<p>s3-bucket: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 2 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 4 <\/p>\n<\/li>\n<li>\n<p>s3-filename: \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0431\u0430\u043a\u0435\u0442\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0445\u044d\u0448 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 <\/p>\n<\/li>\n<li>\n<p>deploy-group: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 6 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 3.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b build: \u0441\u0442\u0430\u0432\u0438\u043c&nbsp;.net, \u043a\u0430\u0447\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0442\u0443\u0442 \u0442\u043e\u0447\u0435\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442, \u0442.\u043a., \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0432 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043a\u0430\u0442\u0438\u0442\u044c) \u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 (.\/bin\/app \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0442\u0440\u043e\u043a\u0430 48). \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b appspec.yml \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0441\u0442\u0440\u043e\u043a\u0438 43-48). \u0414\u0430\u043b\u0435\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0438 51 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c AWS CLI v2, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e action \u0432 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441\u0435 GitHub. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c AWS CLI2, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u043e\u0442 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 6.1, \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d AWS. \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432 AWS S3 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432 AWS CodeDeploy. \u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 GitHub Actions. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 AWS CodeDeploy \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442 EC2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0432 \u043d\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b, \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, CodeDeploy Agent \u043d\u0430 \u043d\u0438\u0445 \u0441\u0445\u043e\u0434\u0438\u0442 \u0432 AWS S3 \u0437\u0430 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442 \u0435\u0451. \u041f\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 AWS CodeDeploy.<\/p>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u0435\u043c<\/h3>\n<p>\u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c push \u0432 GitHub \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u043e\u043d\u043e \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e.. \u0438\u043b\u0438 \u043d\u0435\u0442:) \u041f\u043e \u0445\u043e\u0434\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0433\u0440\u0430\u0431\u043b\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u0441\u0430\u043c \u0432 \u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0431\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0437\u0443.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 pipeline \u043c\u043e\u0436\u043d\u043e \u0442\u044e\u043d\u0438\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 \u0431\u0430\u0433\u0438, \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438, \u0433\u043e\u043d\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0438 \u0440\u0430\u0441\u043a\u0430\u0442\u043a\u0443 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0443\u0440\u044b.<\/p>\n<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/536118\/\"> https:\/\/habr.com\/ru\/post\/536118\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0418\u043c\u0435\u0435\u043c: \u043f\u0440\u043e\u0435\u043a\u0442 web API \u043d\u0430&nbsp;.net core \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0432 GitHub. <\/p>\n<p>\u0425\u043e\u0442\u0438\u043c: \u0430\u0432\u0442\u043e\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0435 AWS EC2 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u0434\u043e\u043c (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 push \u0432 develop \u0432\u0435\u0442\u043a\u0443). <\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: GitHub Actions, AWS CodeDeploy, S3, EC2. <\/p>\n<p>\u041d\u0438\u0436\u0435 flow \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u0433\u043d\u0430\u043b\u0438.<\/p>\n<figure class=\"full-width\"><figcaption>Basic CI\/CD&nbsp;flow<\/figcaption><\/figure>\n<h3>1. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438 \u0440\u043e\u043b\u0438<\/h3>\n<h4>1.1. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a AWS \u0438\u0437 GitHub Action<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a AWS \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c S3 \u0438 CodeDeploy \u0447\u0435\u0440\u0435\u0437 AWS CLI 2 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 GitHub Actions. <\/p>\n<p>1. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS IAM, \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e User, \u0438 Add User <\/p>\n<p>2. \u0417\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 Programmatic access<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/figcaption><\/figure>\n<p>3.  \u0414\u0430\u043b\u0435\u0435, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Permissions \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Attach existing policies directly \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 AmazonS3FullAccess \u0438 AWSCodeDeployDeployerAccess.<\/p>\n<p>4. \u0422\u044d\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 Review \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/figcaption><\/figure>\n<p>5. \u0416\u043c\u0435\u043c Create user \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443 \u0441\u0435\u0431\u044f. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f Access Key ID \u0438 Secret Access Key \u043f\u043e\u0437\u0434\u043d\u0435\u0435.<\/p>\n<h4>1.2. \u0421\u0435\u0440\u0432\u0438\u0441\u043d\u0430\u044f \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 AWS EC2<\/h4>\n<p>\u0420\u043e\u043b\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b EC2, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c AWS CodeDeploy.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS IAM, \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e Role, \u0438 Add Role<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c AWS Service, \u0432 Choose a use case \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c EC2 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 AmazonEC2RoleforAWSCodeDeploy.<\/p>\n<\/li>\n<li>\n<p>\u0422\u044d\u0433\u0438 \u0438 Review \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ProjectXCodeDeployInstanceRole \u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 Review \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h4>1.3. \u0421\u0435\u0440\u0432\u0438\u0441\u043d\u0430\u044f \u0440\u043e\u043b\u044c \u0434\u043b\u044f AWS CodeDeploy<\/h4>\n<p>\u0420\u043e\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0443 AWS CodeDeploy \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c AWS EC2. <\/p>\n<p>1. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS IAM, \u0441\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e Role, \u0438 Add Role <\/p>\n<p>2. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c AWS Service, \u0432 Use case \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c CodeDeploy:<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u043e\u043b\u0438<\/figcaption><\/figure>\n<p>3. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435, \u043d\u0443\u0436\u043d\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043d\u0430\u043c \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c (AWSCodeDeployRole)<\/p>\n<p>4. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ProjectXCodeDeploy \u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 Review \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<figure class=\"full-width\"><figcaption>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u043e\u043b\u0438<\/figcaption><\/figure>\n<h3>2. \u0418\u043d\u0441\u0442\u0430\u043d\u0441 AWS&nbsp;EC2<\/h3>\n<ol>\n<li>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0432 AWS EC2 <\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0435\u043c\u0443 \u0440\u043e\u043b\u044c ProjectXCodeDeployInstanceRole, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 1.2 <\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c CodeDeploy Agent \u043d\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/codedeploy-agent-operations-install.html\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0412\u0430\u0436\u043d\u043e<\/strong>: \u0415\u0441\u043b\u0438 \u0430\u0433\u0435\u043d\u0442\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0443 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043d\u0430\u0432\u0435\u0441\u0438\u043b\u0438 \u0440\u043e\u043b\u044c, \u0442\u043e \u0430\u0433\u0435\u043d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>sudo service codedeploy-agent restart<\/code><\/p>\n<h3>3. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f AWS CodeDeploy<\/h3>\n<p>1. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS CodeDeploy <\/p>\n<p>2. \u0421\u043b\u0435\u0432\u0430 \u0432 \u043c\u0435\u043d\u044e \u043a\u043b\u0438\u043a\u0430\u0435\u043c Deploy, \u0432\u043d\u0443\u0442\u0440\u0438 Applications <\/p>\n<p>3. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u043a\u043d\u0443\u0432 Create application <\/p>\n<p>4. \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, projectx \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Compute platform EC2\/On-Premises<\/p>\n<figure class=\"full-width\"><figcaption>\u041d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/figcaption><\/figure>\n<p>5. \u0414\u0430\u043b\u0435\u0435, \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0448\u0438\u0441\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Create deployment group<\/p>\n<p>6. \u041d\u0430\u0437\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e, develop \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u0420\u043e\u043b\u044c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0443, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 1.3 \u0432\u044b\u0448\u0435 (ProjectXCodeDeploy).<\/p>\n<p>7. Deployment type \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c In place (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442).<\/p>\n<p>8. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Environment configuration \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Amazon EC2 Instances \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u044d\u0433\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b.<\/p>\n<h3>4. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0430\u043a\u0435\u0442 \u043d\u0430 AWS&nbsp;S3<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0431\u0430\u043a\u0435\u0442 \u0432 AWS S3.<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c AWS S3, \u043a\u043b\u0438\u043a\u0430\u0435\u043c Create bucket.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, projectx-codedeploy-deployments. \u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0433\u0430\u043b\u043e\u0447\u043a\u0430 Block all public access. \u0418 \u043f\u043e\u0441\u043b\u0435 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Create bucket.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430 S3<\/figcaption><\/figure>\n<h3>5. \u0421\u043e\u0437\u0434\u0430\u0435\u043c appspec.yml<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b CodeDeploy Agent \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0435\u043c\u0443 \u043e\u0431 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u0412 AWS CodeDeploy \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0440\u043d\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c appspec.yml. \u0412 \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0435 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">version: 0.0 os: linux files:   - source: \/     destination: \/opt\/projectx permissions:   - object: \/opt\/projectx     owner: ubuntu     group: ubuntu     type:       - directory       - file hooks:   ApplicationStart:     - location: scripts\/start_server.sh       timeout: 300       runas: ubuntu   ApplicationStop:     - location: scripts\/stop_server.sh       timeout: 300       runas: ubuntu<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<\/li>\n<li>\n<\/li>\n<li>\n<\/li>\n<li>\n<p> &nbsp;  <\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c appspec.yml  version: 0.0 os: linux files:<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c, \u0433\u0434\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 (\u0441\u0442\u0440\u043e\u043a\u0430 4), \u043a\u0443\u0434\u0430 \u0438\u0445 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c (\u0441\u0442\u0440\u043e\u043a\u0430 5) \u0438 \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 (\u0441\u0442\u0440\u043e\u043a\u0438 6-12). \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0445\u0443\u043a\u043e\u0432 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u0430\u043a \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438 \u0445\u0443\u043a\u0430\u043c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/docs.aws.amazon.com\/codedeploy\/latest\/userguide\/reference-appspec-file.html?appspec-reference-server\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p><strong>\u0412\u0430\u0436\u043d\u043e:<\/strong><em> <\/em>\u0412\u0435\u0440\u0441\u0438\u044e \u043d\u0430\u0434\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c 0.0, \u0442.\u043a. \u0438\u043d\u0430\u0447\u0435 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f CodeDeploy \u0438 \u0432 \u0432\u0435\u0431-\u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e <u>0.0<\/u> \u00af\\_(\u30c4)\/\u00af. \u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0434\u0435\u043f\u043b\u043e\u0439\u043c\u0435\u043d\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u043d\u0442\u0438\u0442\u044c \u0445\u0443\u043a ApplicationStop, \u0438\u043d\u0430\u0447\u0435 \u043d\u0430 \u043d\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u0421\u0432\u044f\u0437\u0430\u043d\u043e \u044d\u0442\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0430\u0433\u0435\u043d\u0442 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0449\u0435 \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u0412\u0442\u043e\u0440\u043e\u0435 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 ApplicationStop \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<h3>6. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c GitHub&nbsp;Actions<\/h3>\n<p>\u041f\u043e\u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c CI\/CD pipeline \u043d\u0430 \u0431\u0430\u0437\u0435 GitHub Actions.<\/p>\n<h4>6.1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b<\/h4>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 GitHub \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Settings, \u0434\u0430\u043b\u0435\u0435 \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 Secrets \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>AWS_ACCESS_KEY_ID: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 5 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 1.1 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a AWS<\/p>\n<\/li>\n<li>\n<p>AWS_SECRET_ACCESS_KEY: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 5 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 1.1 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a AWS<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h4>6.2. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>.github\/workflows<\/code>. \u0412 \u043d\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0438 \u0444\u0430\u0439\u043b\u044b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c pipeline&#8217;\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, develop.yaml. \u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: <\/p>\n<pre><code class=\"bash\">name: build-app-action on:    push:     branches:       - develop jobs:   build:     name: CI part     runs-on: ubuntu-latest     steps:       - uses: actions\/checkout@v2       - name: Setup .NET Core         uses: actions\/setup-dotnet@v1         with:           dotnet-version: 5.0.101       - name: Install dependencies         run: dotnet restore       - name: Build         run: dotnet build --configuration Release --no-restore      deploy:     name: CD part     runs-on: ubuntu-latest     strategy:       matrix:         app-name: ['projectx']         s3-bucket: ['projectx-codedeploy-deployments']         s3-filename: ['develop-aws-codedeploy-${{ github.sha }}']         deploy-group: ['develop']     needs: build     steps:       - uses: actions\/checkout@v2       # set up .net core       - name: Setup .NET Core         uses: actions\/setup-dotnet@v1         with:           dotnet-version: 5.0.101       # restore packages and build       - name: Install dependencies         run: dotnet restore       - name: Build         run: dotnet build ProjectX --configuration Release --no-restore -o .\/bin\/app       # copying appspec file       - name: Copying appspec.yml         run: cp appspec.yml .\/bin\/app       # copying scripts       - name: Copying scripts         run: cp -R .\/scripts .\/bin\/app\/scripts              # Install AWS CLI 2       - name: Install AWS CLI 2         run: |           curl \"https:\/\/awscli.amazonaws.com\/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"           unzip awscliv2.zip           sudo .\/aws\/install       # Configure AWS credentials       - name: Configure AWS Credentials         uses: aws-actions\/configure-aws-credentials@v1         with:           aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}           aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}           aws-region: ap-south-1       # Deploy push to S3       - name: AWS Deploy push         run: |           aws deploy push \\           --application-name ${{ matrix.app-name }} \\           --description \"Revision of the ${{ matrix.appname }}-${{ github.sha }}\" \\           --ignore-hidden-files \\           --s3-location s3:\/\/${{ matrix.s3-bucket }}\/${{ matrix.s3-filename }}.zip \\           --source .\/bin\/app       # Creating deployment via CodeDeploy       - name: Creating AWS Deployment         run: |           aws deploy create-deployment \\           --application-name ${{ matrix.app-name }} \\           --deployment-config-name CodeDeployDefault.AllAtOnce \\           --deployment-group-name ${{ matrix.deploy-group }} \\           --file-exists-behavior OVERWRITE \\           --s3-location bucket=${{ matrix.s3-bucket }},key=${{ matrix.s3-filename }}.zip,bundleType=zip \\<\/code><\/pre>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0443 \u043d\u0430\u0441 \u0434\u0432\u0430 \u0434\u0436\u043e\u0431\u0430: \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0433\u043e (\u0440\u0430\u0437\u0434\u0435\u043b needs \u0432 deploy, \u0441\u0442\u0440\u043e\u043a\u0430 31). \u0421\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043d\u0430 push \u0432 \u0432\u0435\u0442\u043a\u0443 develop (\u0441\u0442\u0440\u043e\u043a\u0438 2-5). <\/p>\n<p><strong>\u0428\u0430\u0433 build<\/strong><\/p>\n<p>\u041c\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c&nbsp;.net, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 11-19. \u0421\u0431\u043e\u0440\u043a\u0443 \u043c\u044b \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c \u043d\u0430 Ubuntu (\u0441\u0442\u0440\u043e\u043a\u0438 9 \u0438 23) \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c unit-\u0442\u0435\u0441\u0442\u044b. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0448\u0430\u0433\u0443 deploy. <\/p>\n<p><strong>\u0428\u0430\u0433 deploy<\/strong><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u0442\u0438\u043f\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438. <\/p>\n<ul>\n<li>\n<p>app-name: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 4 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 3 \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 CodeDeploy <\/p>\n<\/li>\n<li>\n<p>s3-bucket: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 2 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 4 <\/p>\n<\/li>\n<li>\n<p>s3-filename: \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432 \u0431\u0430\u043a\u0435\u0442\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0445\u044d\u0448 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 <\/p>\n<\/li>\n<li>\n<p>deploy-group: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0435\u043b\u0438 \u043d\u0430 \u0448\u0430\u0433\u0435 6 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 3.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b build: \u0441\u0442\u0430\u0432\u0438\u043c&nbsp;.net, \u043a\u0430\u0447\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0442\u0443\u0442 \u0442\u043e\u0447\u0435\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442, \u0442.\u043a., \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0432 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043a\u0430\u0442\u0438\u0442\u044c) \u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 (.\/bin\/app \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0442\u0440\u043e\u043a\u0430 48). \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b appspec.yml \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0441\u0442\u0440\u043e\u043a\u0438 43-48). \u0414\u0430\u043b\u0435\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0438 51 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c AWS CLI v2, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e action \u0432 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441\u0435 GitHub. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c AWS CLI2, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u043e\u0442 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 GitHub \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 6.1, \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0433\u0438\u043e\u043d AWS. \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432 AWS S3 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432 AWS CodeDeploy. \u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 GitHub Actions. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 AWS CodeDeploy \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442 EC2 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0432 \u043d\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b, \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, CodeDeploy Agent \u043d\u0430 \u043d\u0438\u0445 \u0441\u0445\u043e\u0434\u0438\u0442 \u0432 AWS S3 \u0437\u0430 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442 \u0435\u0451. \u041f\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 AWS CodeDeploy.<\/p>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u0435\u043c<\/h3>\n<p>\u041a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e<\/p>\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-315962","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315962","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=315962"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315962\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}