๐Ÿš€ Languege/DevOps 5

AWS Codepipeline lambda ์‹คํ–‰ํ•˜๊ธฐ

Codepipeline์—์„œ lambda๋ฅผ ์‹คํ–‰ํ•˜๋ ค๋ฉด, Codepipelin์—๊ฒŒ ์™„๋ฃŒ๋˜์—ˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ์•Œ๋ ค์ค˜์•ผ ํ•œ๋‹ค. ์•„๋ž˜ ์ฝ”๋“œ๋Š” ๋‹จ๋…์‹คํ–‰ task๋ฅผ ์œ„ํ•œ ์ƒ˜ํ”Œ ์ฝ”๋“œ์ด๋‹ค. import urllib3 import json import boto3 import json import botocore.exceptions def lambda_handler(event, context): client = boto3.client("ecs", region_name="ap-northeast-2") waiter = client.get_waiter('tasks_stopped') code_pipeline = boto3.client('codepipeline') job_id = event['CodePipeline.job']['id'] ..

CodePipeline ECR Rolling Update๋ฅผ ์œ„ํ•œ TaskDefinition Update Lambda ์ฝ”๋“œ

CodePipelin ๊ตฌ์„ฑ ์‹œ, ๋นŒ๋“œ๊ณผ์ • ์—†์ด ECR -> ECS ์— ๋ฐ”๋กœ ๋ฐฐํฌํ•œ๋‹ค๋ฉด TaskDefinition ํŒŒ์ผ์„ ์—…๋ฐ์ดํŠธ ํ•ด์ค˜์•ผ ํ•œ๋‹ค. ๊ทธ๋Ÿฌ์ž๊ณ  Codebuild๋ฅผ ์“ฐ์ž๋‹ˆ, ํŒŒ์ผ ๋งŒ๋“œ๋Š”๋ฐ ๋ช‡์ดˆ๋ฉด ๋๋‚˜๋Š”๋ฐ, ๋น„์šฉ๋„ ๋น„์šฉ์ด๊ณ  codebuild๋Š” ๋ฌด๊ฒ๋‹ค ใ…  (์ด๊ฑฐ ๋Œ๋ฆฌ๋Š”๋ฐ 4๋ถ„๊ฑธ๋ฆฐ๋‹ค..) lambda๋กœ ํ•˜๋ฉด 30์ดˆ๋ฉด ๋๋‚˜๋‹ˆ ์ด๋ ‡๊ฒŒ ํ•ด๋ณด๋Š”๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค. =========================================== Source ------> Def-Step ------> ECS (rolling update) [ECR] [Lambda] =========================================== import json import boto3 import zipfile imp..

CI/CD ๊ณต๋ถ€ ๋…ธํŠธ #2

https://www.youtube.com/watch?v=3WZoVkvLE4A 3. ๊ฐœ๋ฐœํ™˜๊ฒฝ ๋ฐ CI/CD์˜ ๊ธฐ๋ณธ ๋™์ž‘ ์ดํ•ด ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ข…๋ฅ˜ ๊ฐœ๋ฐœ์ž์˜ ๋กœ์ปฌ ํ™˜๊ฒฝ ํ†ตํ•ฉํ…Œ์ŠคํŠธ QAํ™˜๊ฒฝ ์‹ค์œ ์ € ํ”„๋กœ๋•์…˜ ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค ๊ฐœ๋ฐœ์ž๊ฐ€ ์ž์‹ ์˜ PC์—์„œ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•œ๋‹ค. ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ์™€ ์ฐจ์ด๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”์ง€ ๋‚ด๋ถ€ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค. ์ง„ํ–‰ํ•œ ๋‚ด์šฉ์„ ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๋“ค๊ณผ ๋™์œ ํ•˜๊ธฐ ์œ„ํ•ด git ๊ฐ™์€ SCM์— ์˜ฌ๋ฆฐ๋‹ค -> dev ๋ธŒ๋žœ์น˜ Dev๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์„ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•˜๊ธฐ ์ „์— Lint๋“ฑ ์ฝ”๋“œ ํฌ๋ฉงํŒ…์„ ํ•œ๋‹ค ๋ฐฐํฌํ•˜๊ธฐ ์œ„ํ•œ ๋นŒ๋“œ ๊ณผ์ •์„ ๊ฑฐ์นœ๋‹ค ์ฝ”๋“œ๋ฅผ ๋ฐฐํฌํ•œ๋‹ค ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค ์œ„ ๊ณผ์ •์„ Dev, QA, PRDํ™˜๊ฒฝ์—์„œ ๋ชจ๋‘ ํ•˜๊ณ  ๊ฐ๊ฐ ๋งž๋Š” ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•œ๋‹ค. ์—ฌ๋Ÿฌ ๋ฐฐํฌํ™˜๊ฒฝ์˜ ๊ด€๋ฆฌ ์—ฌ๋Ÿฌ ๋ฐฐํฌํ™˜๊ฒฝ์˜ ๊ด€๋ฆฌ์—์„œ ํ•ต์‹ฌ์€ ์ธํ”„๋ผ..

CI/CD ๊ณต๋ถ€ ๋…ธํŠธ #1

https://www.youtube.com/watch?v=JPDKLgX5bRg&t=24s 1. CI/CD๋ž€ ๋ฌด์—‡์ธ๊ฐ€? Continuous Integration : ์—ฌ๋Ÿฌ ๊ฐœ๋ฐœ์ž๋“ค์˜ ์ฝ”๋“œ๋ฒ ์ด์Šค๋ฅผ ๊ณ„์†ํ•ด์„œ ํ†ตํ•ฉํ•˜๋Š”๊ฒƒ Continuous Delivery : ์‚ฌ์šฉ์ž์—๊ฒŒ ์ œํ’ˆ/์„œ๋น„์Šค๋ฅผ ์ง€์†์ ์œผ๋กœ ์ œ๊ณต, ์ฝ”๋“œ๋ฒ ์ด์Šค๊ฐ€ ํ•ญ์ƒ ๋ฐฐํฌ ๊ฐ€๋Šฅํ•œ ์ƒํƒœ๋ฅผ ์œ ์ง€ํ•˜๋Š”๊ฒƒ Continuous Deployment : ์ฝ”๋“œ๋ฒ ์ด์Šค๋ฅผ ์‚ฌ์šฉ์ž๊ฐ€ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•œ๋Š๊ฒƒ์„ ์ž๋™ํ™” ํ•˜๋Š”๊ฒƒ ์ฆ‰, ์ฝ”๋“œ ๋นŒ๋“œ&ํ…Œ์ŠคํŠธ&๋ฐฐํฌ ์ž๋™ํ™”! ๊ฐ ๋‹จ๊ณ„๋ฅผ ํ•˜๋‚˜์˜ ํŒŒ์ดํ”„๋ผ์ธ์œผ๋กœ ์ •์˜ ์ฝ”๋“œ ์ž‘์„ฑ ๋นŒ๋“œ: webpack, ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ, ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ ํ…Œ์ŠคํŠธ: Jest, Junit ๋ฐฐํฌ: ... 2. ์  ํ‚จ์Šค์˜ ๊ธฐ๋ณธ ๊ฐœ๋…๊ณผ ๋™์ž‘ ๋ฐฉ์‹ ์  ํ‚จ์Šค๊ฐ€ ๋ญ์•ผ? ๊ท€์ฐฎ์€ ์ž‘์—…(..

[AWS Code Commit] Mac codecommit 403 Error (The requested URL returned error: 403)

MAC ์œ ์ €๋“ค ์ค‘ AWS Code Commit ์ž๊ฒฉ์ฆ๋ช… ์˜ค๋ฅ˜(403) ๊ฐ€๋”... ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. fatal: unable to access '[git์ €์žฅ์†Œ๋ช…]': The requested URL returned error: 403 # git push https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info fatal: unable to access 'https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info/': The requested URL returned error: 403 ์•„๋ž˜ ์ˆœ์„œ์— ๋”ฐ๋ผ ๋ชจ๋“ ๊ฒƒ์ด ์ •์ƒ์ธ์ง€ ํ™•์ธํ•ด๋ด…๋‹ˆ๋‹ค. 1. git ์ž๊ฒฉ์ฆ๋ช… ์„ค์ •ํŒŒ์ผ ํ™•..

728x90