buildspec 예제

version: 0.2

phases:
  pre_build:
    commands:
      - sudo rm -rf /etc/localtime
      - sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
      - aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin $ECR_URL
  build:
    commands:
      - docker build -t temp .
      - export NAME="$(date '+%Y-%m-%d.%H.%M.%S')"
      - docker tag temp:latest $ECR_URL:$NAME
  post_build:
    commands:
      - docker push $ECR_URL:$NAME
artifacts:
    files:
      - "**/*"