{"id":388,"date":"2020-03-29T21:21:25","date_gmt":"2020-03-29T12:21:25","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=388"},"modified":"2020-03-29T21:51:42","modified_gmt":"2020-03-29T12:51:42","slug":"ci-cd-ec2-%ec%97%90-jar-%eb%b0%b0%ed%8f%ac-2-5","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=388","title":{"rendered":"[CI\/CD] EC2 \uc5d0 jar \ubc30\ud3ec (3\/3)"},"content":{"rendered":"<h1>EC2 \uc5d0 jar \ubc30\ud3ec<\/h1>\n<h2>EC2 \uc6a9 IAM \uc5ed\ud560\ucd94\uac00<\/h2>\n<p><code>IAM<\/code> \uc5d0 <code>\uc5ed\ud560<\/code> \uc744 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<p><code>ec2-codedeploy-role<\/code> \ub610\ub294 \uc6d0\ud558\ub294 \uc774\ub984\uc73c\ub85c \uc5ed\ud560\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<p><code>\uc2e0\ub8b0\ud560 \uc218 \uc788\ub294 \uc720\ud615\uc758 \uac1c\uccb4 \uc120\ud0dd<\/code> \uc5d0 <code>AWS \uc11c\ube44\uc2a4<\/code> \ub97c \uc120\ud0dd\ud558\uace0, <code>\uc0ac\uc6a9 \uc0ac\ub840 \uc120\ud0dd<\/code> \uc5d0 <code>EC2<\/code> \ub97c \uc120\ud0dd \ud6c4, <code>\ub2e4\uc74c : \uad8c\ud55c<\/code> \uc744 \ud074\ub9ad\ud569\ub2c8\ub2e4.<\/p>\n<p><code>AmazonEC2RoleforAWSCodeDeploy<\/code> \uc744 \uc120\ud0dd\ud558\uace0 \uc5ed\ud560\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<h2>CodeDeploy \uc6a9 IAM \uc5ed\ud560\ucd94\uac00<\/h2>\n<p><code>IAM<\/code> \uc5d0 <code>\uc5ed\ud560<\/code> \uc744 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<p><code>codedeploy-role<\/code> \ub610\ub294 \uc6d0\ud558\ub294 \uc774\ub984\uc73c\ub85c \uc5ed\ud560\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<p><code>\uc2e0\ub8b0\ud560 \uc218 \uc788\ub294 \uc720\ud615\uc758 \uac1c\uccb4 \uc120\ud0dd<\/code> \uc5d0 <code>AWS \uc11c\ube44\uc2a4<\/code> \ub97c \uc120\ud0dd\ud558\uace0, <code>\uc0ac\uc6a9 \uc0ac\ub840 \uc120\ud0dd<\/code> \uc5d0 <code>CodeDeploy<\/code> \ub97c \uc120\ud0dd \ud6c4, <code>\ub2e4\uc74c : \uad8c\ud55c<\/code> \uc744 \ud074\ub9ad\ud569\ub2c8\ub2e4.<\/p>\n<p><code>AWSCodeDeployRole<\/code> \ub2e8 \ud558\ub098\ubc16\uc5d0 \uc5c6\uc73c\ubbc0\ub85c \uc120\ud0dd\uc5c6\uc774 \uc5ed\ud560\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<h2>EC2 \uc778\uc2a4\ud134\uc2a4 \uc0dd\uc131<\/h2>\n<p>\uc778\uc2a4\ud134\uc2a4\ub97c \uc0dd\uc131\ud558\uace0, \uc774\ub984\uc744 \uc9c0\uc815\ud569\ub2c8\ub2e4.(\ubcf4\uc548\uadf8\ub8f9\uc5d0 ssh \uc640 8080\ud3ec\ud2b8\ub97c \uc5f4\uc5b4\uc90d\ub2c8\ub2e4.)<\/p>\n<p><a href=\"\/wordpress\/?p=394\">\uc5ec\uae30<\/a> \ub97c \ucc38\uc870\ud558\uc5ec CodeDeploy \uc5d0\uc774\uc804\ud2b8\ub97c \uc124\uce58\ud569\ub2c8\ub2e4.<\/p>\n<p><a href=\"\/wordpress\/?p=140\">\uc5ec\uae30<\/a> \ub97c \ucc38\uc870\ud558\uc5ec JDK \ub97c \uc124\uce58\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc778\uc2a4\ud134\uc2a4\uc5d0 \uc778\uc2a4\ud134\uc2a4 \uc124\uc815 &gt; IAM \uc5ed\ud560 \uc5f0\uacb0\/\ubc14\uafb8\uae30 \uc5d0\uc11c, \uc704\uc5d0\uc11c \uc0dd\uc131\ud55c <code>ec2-codedeploy-role<\/code> \ub97c \uc124\uc815\ud558\uace0, \uc778\uc2a4\ud134\uc2a4\ub97c \uc7ac\ubd80\ud305\ud569\ub2c8\ub2e4.<\/p>\n<h2>CodeDeploy \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc0dd\uc131<\/h2>\n<p><code>CodeDeploy<\/code> \ub85c \uc774\ub3d9\ud558\uc5ec, <code>\uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc0dd\uc131<\/code> \ubc84\ud2bc\uc744 \ud074\ub9ad\ud558\uc5ec \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/p>\n<p><code>\uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc774\ub984<\/code> \uc744 \uc785\ub825\ud558\uace0, <code>\ucef4\ud4e8\ud305 \ud50c\ub7ab\ud3fc<\/code> \uc740 <code>EC2\/\uc628\ud504\ub808\ubbf8\uc2a4<\/code> \ub97c \uc120\ud0dd\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc0dd\uc131\ub418\uba74, <code>\ubc30\ud3ec\uadf8\ub8f9\uc0dd\uc131<\/code> \ubc84\ud2bc\uc744 \ud074\ub9ad\ud569\ub2c8\ub2e4.<\/p>\n<p>\ubc30\ud3ec\uadf8\ub8f9 \uc774\ub984\uc744 \uc785\ub825\ud558\uace0, \uc11c\ube44\uc2a4 \uc5ed\ud560\uc5d0 \uc704\uc5d0\uc11c \uc0dd\uc131\ud55c <code>codedeploy-role<\/code> \uc744 \uc785\ub825\ud569\ub2c8\ub2e4.<\/p>\n<p>\ubc30\ud3ec\uc720\ud615\uc740 \ud604\uc7ac\uc704\uce58\ub97c \uc120\ud0dd\ud569\ub2c8\ub2e4.<\/p>\n<p>\ud0dc\uadf8 \ud0a4\uc5d0 Name \uc744 \uc785\ub825\ud558\uace0, \uac12\uc5d0 \uc0dd\uc131\ud55c EC2 \uc778\uc2a4\ud134\uc2a4\uc758 \uc774\ub984\uc744 \uc120\ud0dd\ud569\ub2c8\ub2e4.<\/p>\n<p>\ud658\uacbd\uc124\uc815\uc5d0 Amazon EC2 \uc778\uc2a4\ud134\uc2a4\ub97c \uccb4\ud06c\ud558\uace0, \ubc30\ud3ec\uc124\uc815\uc740 CodeDeployDefault.AllAtOnce \ub97c \uc785\ub825\ud569\ub2c8\ub2e4.<\/p>\n<p>\ub85c\ub4dc \ubc38\ub7f0\uc2f1 \ud65c\uc131\ud654\ub294 \uccb4\ud06c \ud574\uc81c\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n<h2>.travis.yml \uc218\uc815<\/h2>\n<p>.travis.yml \uc5d0 \uc544\ub798 \ub0b4\uc6a9\uc744 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-yaml\">......\ndeploy:\n  - provider: s3\n    access_key_id: $AWS_ACCESS_KEY\n    secret_access_key: $AWS_SECRET_KEY\n    bucket: skyer9-deploy\n    region: ap-northeast-2\n    skip_cleanup: true\n    acl: private\n    local_dir: deploy\n    wait-until-deployed: true\n  - provider: codedeploy\n    access_key_id: $AWS_ACCESS_KEY\n    secret_access_key: $AWS_SECRET_KEY\n    bucket: skyer9-deploy\n    key: TestCI2.zip\n    application: test-ci2               # CodeDeploy \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc0dd\uc131\uc2dc \uc785\ub825\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc774\ub984\n    deployment_group: codedeploy-group  # CodeDeploy \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc0dd\uc131\uc2dc \uc785\ub825\ud55c \ubc30\ud3ec\uadf8\ub8f9 \uc774\ub984\n    bundle_type: zip\n    region: ap-northeast-2\n    wait-until-deployed: true\n......<\/code><\/pre>\n<p>\ucee4\ubc0b\uc744 \ud558\uba74 EC2 \uc778\uc2a4\ud134\uc2a4\uc5d0 \ubc30\ud3ec\ub429\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>EC2 \uc5d0 jar \ubc30\ud3ec EC2 \uc6a9 IAM \uc5ed\ud560\ucd94\uac00 IAM \uc5d0 \uc5ed\ud560 \uc744 \ucd94\uac00\ud569\ub2c8\ub2e4. ec2-codedeploy-role \ub610\ub294 \uc6d0\ud558\ub294 \uc774\ub984\uc73c\ub85c \uc5ed\ud560\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc2e0\ub8b0\ud560 \uc218 \uc788\ub294 \uc720\ud615\uc758 \uac1c\uccb4 \uc120\ud0dd \uc5d0 AWS \uc11c\ube44\uc2a4 \ub97c \uc120\ud0dd\ud558\uace0, \uc0ac\uc6a9 \uc0ac\ub840 \uc120\ud0dd \uc5d0 EC2 \ub97c \uc120\ud0dd \ud6c4, \ub2e4\uc74c : \uad8c\ud55c \uc744 \ud074\ub9ad\ud569\ub2c8\ub2e4. AmazonEC2RoleforAWSCodeDeploy \uc744 \uc120\ud0dd\ud558\uace0 \uc5ed\ud560\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4. CodeDeploy \uc6a9 IAM \uc5ed\ud560\ucd94\uac00 IAM \uc5d0 \uc5ed\ud560\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=388\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-388","post","type-post","status-publish","format-standard","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=388"}],"version-history":[{"count":9,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}