JSCODE Logo
블로그후기멘토진
회사명 : JSCODE대표 : 박재성사업자 등록번호 : 244-22-01557통신판매업 : 제 2023-인천미추홀-0381 호
학원 명칭 : 제이에스코드(JSCODE)원격학원학원설립ㆍ운영 등록번호 : 제6063호

서울특별시 구로구 경인로 20가길 11(오류동, 아델리아)

Copyright ⓒ 2025 JSCODE - 최상위 현업 개발자들의 프로그래밍 교육 All rights reserved.

이용약관개인정보처리방침
← 블로그 목록으로 돌아가기

[실습] AWS CLI를 사용하는 이유 / AWS CLI 설치방법

JSCODE 시니
JSCODE 시니
2026. 04. 09.
author
JSCODE 시니
category
Jenkins CI/CD
createdAt
Apr 9, 2026 12:57 PM
isPublic
isPublic
series
Jenkins를 활용한 CI/CD 입문 (with.AWS)
slug
why-use-aws-cli-and-installation
type
post
updatedAt

✅ 1. AWS CLI를 사용하는 이유

우리는 AWS 클라우드 안에 S3 버킷을 생성했다. 그렇다면 Jenkins를 활용해서 방금 생성한 S3 버킷에 파일을 업로드할 수 있을까? 바로 CLI(Command Line Interface)를 사용해야 한다. Jenkins는 실제로 브라우저를 열 수 없기 때문에, 해당 도구를 활용해야만 S3에 접근 할 수 있다.
 
 
 

✅ 2. AWS CLI 설치 방법

  • AWS CLI를 설치하는 방법은 여러 가지가 있다. 우리는 Docker Hub에 업로드된 이미지를 통해 설치해보려 한다.
amazon/aws-cli - Docker Image
This is a Docker image for the AWS CLI⁠. It is a unified command line tool to interact with AWS services and manage your AWS resources.
amazon/aws-cli - Docker Image
https://hub.docker.com/r/amazon/aws-cli
  • AWS CLI는 명령어를 통해 동작한다. 해당 명령어에 대한 지식을 얻고 싶다면 다음 페이지를 활용한다.
aws — AWS CLI 2.34.16 Command Reference
Did you find this page useful? Do you have a suggestion to improve the documentation? Give us feedback. If you would like to suggest an improvement or fix for the AWS CLI, check out our contributing guide on GitHub.
aws — AWS CLI 2.34.16 Command Reference
https://docs.aws.amazon.com/cli/latest/reference/
  • 참고로 해당 문서는 가장 최신의 버전을 가지고 작성한 페이지이다. 버전 혼동이 없도록 주의할 것
  • Jenkinsfile을 다음과 같이 수정한다.
Jenkinsfile
pipeline { // 전역 에이전트를 사용하지 않음으로써 컨테이너 중첩 방지 agent none environment { NETLIFY_SITE_ID = '자신의 사이트 ID' NETLIFY_AUTH_TOKEN = credentials('netlify-token') } stages { stage('AWS') { agent { docker { image 'amazon/aws-cli' // aws-cli 이미지는 기본적으로 실행 후 바로 종료되므로 엔트리포인트 무력화 args "--entrypoint=''" } } steps { sh 'aws --version' } } stage('Build') { agent { docker { image 'mcr.microsoft.com/playwright:v1.39.0-jammy' } } steps { sh ''' echo '빌드 시작..' node --version npm --version npm ci npm run build ''' } } stage('Test') { agent { docker { image 'mcr.microsoft.com/playwright:v1.39.0-jammy' } } steps { sh ''' npm test ''' } } stage('E2E') { agent { docker { image 'mcr.microsoft.com/playwright:v1.39.0-jammy' } } steps { sh ''' # serve를 로컬에 설치하여 실행 npm install serve node_modules/.bin/serve -s build & sleep 10 npx playwright test --reporter=html ''' } } stage('Deploy staging') { agent { docker { image 'node:18-bullseye' } } steps { sh ''' npm install netlify-cli@20.1.1 node_modules/.bin/netlify deploy --dir=build ''' } } stage('Approval'){ agent none steps { timeout(time: 15, unit: 'MINUTES') { input message: '운영환경에 배포할까요?', ok: '네 배포합니다' } } } stage('Deploy prod') { agent { docker { image 'node:18-bullseye' } } steps { sh ''' npm install netlify-cli@20.1.1 node_modules/.bin/netlify deploy --dir=build --prod ''' } } stage('Prod E2E') { agent { docker { image 'mcr.microsoft.com/playwright:v1.39.0-jammy' } } environment { CI_ENVIRONMENT_URL = 'https://legendary-mousse-2c5c10.netlify.app' } steps { sh 'npx playwright test --reporter=html' } } } }
  • 실습 파일이 무거워서 Build 속도가 너무 느리다면 해당 파일로 덮어쓰기 해도 무방하다. 더 가벼운 Dokcer Image로 Jenkinsfile을 수정하고 post 옵션을 제거했으니 참고 할 것
notion image
  • 다음과 같이 aws —verision에 대한 값이 잘 출력이 된다면 설치가 잘된 것이다.
 
author
category
Jenkins CI/CD
createdAt
Apr 9, 2026 01:25 PM
isPublic
isPublic
series
Jenkins를 활용한 CI/CD 입문 (with.AWS)
slug
type
series-footer
updatedAt
📎
이 글은 Jenkins를 활용한 CI/CD 입문 (with.AWS) 강의의 수업 자료 중 일부입니다.