2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【AWS】【ECR】【CircleCI】ECRにイメージをプッシュするときにハマったとこ

Last updated at Posted at 2020-07-19

circleciのログはSUCCESSなのにECRにイメージがない

以下、nginxイメージをプッシュするコード

.circleci/config.yml
version: 2.1 
orbs:
  aws-ecr: circleci/aws-ecr@6.10.0
workflows:
  build_and_push_image_nginx:
    jobs:
      - aws-ecr/build-and-push-image:
          account-url: AWS_ECR_ACCOUNT_URL_ENV_VAR_NAME_NGINX
          aws-access-key-id: ACCESS_KEY_ID_ENV_VAR_NAME
          aws-secret-access-key: SECRET_ACCESS_KEY_ENV_VAR_NAME
          dockerfile: Dockerfile
          no-output-timeout: 20m
          path: ./nginx
          region: AWS_REGION_ENV_VAR_NAME
          repo: 'nginx' 
          tag: $CIRCLE_SHA1 # <- これが原因だった "${CIRCLE_SHA1}"と書いていたため、中身がなくecrに認めてもらえなかった
          filters:
            branches:
              ignore:
                - master

CIRCLE_SHA1の中身は次の通り。
スクリーンショット 2020-07-19 19.06.46.png
tag: $CIRCLE_SHA1とすると、CircleCIで定義済みの環境変数があたるので、問題なし。
スクリーンショット 2020-07-19 19.04.44.png

Circleciの環境変数の使い方
Amazon ECR リポジトリのタグ付け

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?