커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
Docker 어플리케이션 배포 자동화하기 과정중 질문
[스킬업] Docker 기반 CI/CD 파이프라인 구축하기 v0
3주차
북마크
임*삭
댓글
1
추천
0
조회수
42
조회수
42
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


Makefile에

"deploy: aws ecs update-service --cluster test-app-cluster --service sparta-app-srv --task-definition test-app:1 --force-new-deployment"

해당 내용을 추가하고 git push 후 Pipeline에 depoly-job에 make depoly를 추가해줬는데

depoly-job에서 실패가 떴습니다.


실패 내용을 보니까

You must specify a region. You can also configure your region by running "aws configure".

라고 나왔는데 region name을 입력하지 않아서 생긴 현상이라고 하는데 config에는 다 추가되어 있는데

혹시 다른 곳에 또 설정을 해줘야하나요?

아니면 다른 해결 방법이 있을까요?


스파르타 즉문즉답


작성한 코드 및 에러 메세지

Makefile

PRJ_NAME=프로젝트이름
ECR_=ECR URI
VERSION:=$(shell git rev-parse --short HEAD)


build:
	docker build -t $(PRJ_NAME):$(VERSION) .
	
push:
	aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin $(ECR_URI)
	docker tag $(PRJ_NAME):$(VERSION) $(ECR_URI)/$(PRJ_NAME):$(VERSION)
	docker tag $(PRJ_NAME):$(VERSION) $(ECR_URI)/$(PRJ_NAME):latest
	docker push $(ECR_URI)/$(PRJ_NAME):$(VERSION)
	docker push $(ECR_URI)/$(PRJ_NAME):latest
deploy:
	aws ecs update-service --cluster test-app-cluster  --service sparta-app-srv --task-definition test-app:1 --force-new-deployment



pipeline editor

stages:          # List of stages for jobs, and their order of execution
  - build
  - test
  - deploy


build-job:       # This job runs in the build stage, which runs first.
  stage: build
  script:
    - echo "Compiling the code..."
    - echo "Compile complete."


unit-test-job:   # This job runs in the test stage.
  stage: test    # It only starts when the job in the build stage completes successfully.
  script:
    - echo "Running unit tests... This will take about 60 seconds."
    - sleep 20
    - echo "Code coverage is 90%"


lint-test-job:   # This job also runs in the test stage.
  stage: test    # It can run at the same time as unit-test-job (in parallel).
  script:
    - echo "Linting code... This will take about 10 seconds."
    - sleep 10
    - echo "No lint issues found."


deploy-job:      # This job runs in the deploy stage.
  stage: deploy  # It only runs when *both* jobs in the test stage complete successfully.
  environment: production
  script:
    - echo "Deploying application..."
    - make deploy
    - echo "Application successfully deployed."


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴