Skip to content

Commit 6c68940

Browse files
author
Jiyeon Baek
committed
fix script
1 parent bc92963 commit 6c68940

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

script/add-container-tag

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ if [ -z "$TAG_TO_ADD" ] || [ -z "$DOCKER_REGISTRY" ]; then
6161
exit 1
6262
fi
6363

64-
# stdin에서 이미지 목록을 배열로 읽기
65-
mapfile -t IMAGES
66-
67-
if [ ${#IMAGES[@]} -eq 0 ]; then
68-
echo "Error: No images found"
69-
exit 1
70-
fi
71-
7264
# if ECR
7365
if [[ "$DOCKER_REGISTRY" == *".dkr.ecr."* ]]; then
7466
TOKEN=$(aws ecr get-login-password --region us-east-1)
@@ -79,6 +71,17 @@ if [[ -z "$TOKEN" && "$DOCKER_REGISTRY" == *".dkr.ecr."* ]]; then
7971
exit 1
8072
fi
8173

74+
# stdin에서 이미지 목록을 배열로 읽기
75+
IMAGES=()
76+
while IFS= read -r line; do
77+
IMAGES+=("$line")
78+
done
79+
80+
if [ ${#IMAGES[@]} -eq 0 ]; then
81+
echo "Error: No images found"
82+
exit 1
83+
fi
84+
8285
for IMAGE in "${IMAGES[@]}"; do
8386
if [[ $IMAGE != *"$DOCKER_REGISTRY"* ]]; then
8487
echo "Skipping: $IMAGE (not from $DOCKER_REGISTRY)"

0 commit comments

Comments
 (0)