#!/bin/bash

cd ../../lambda/check-view-security-option || { echo "Error: ディレクトリ変更に失敗しました"; exit 1; }

pipenv update || { echo "pipenv update failed"; exit 1; }

docker pull public.ecr.aws/lambda/python:3.12

aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin 826466435614.dkr.ecr.ap-northeast-1.amazonaws.com

docker build -t mbj-newdwh2021-staging-check-view-security-option-ecr . --no-cache

docker tag mbj-newdwh2021-staging-check-view-security-option-ecr:latest 826466435614.dkr.ecr.ap-northeast-1.amazonaws.com/mbj-newdwh2021-staging-check-view-security-option-ecr:scan-point

docker push 826466435614.dkr.ecr.ap-northeast-1.amazonaws.com/mbj-newdwh2021-staging-check-view-security-option-ecr:scan-point

