Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Switch to using bash for ecr bootstrap script to use an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Rodriguez committed Oct 4, 2023
1 parent 2f6be8e commit 65976db
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bootstrap/ecr.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

REPO_NAME="defenseunicorns/pepr/controller"
ECR_CMD="ecr"
Expand Down Expand Up @@ -26,11 +26,12 @@ if ! aws "$ECR_CMD" describe-repositories \
--repository-names "$REPO_NAME" \
--region "$AWS_REGION" >/dev/null 2>&1
then
ARGS="--repository-name $REPO_NAME --region $AWS_REGION"
ARGS=("--repository-name" "$REPO_NAME" "--region" "$AWS_REGION")

if [ "$REGISTRY_TYPE" = "private" ]; then
ARGS="$ARGS --image-scanning-configuration scanOnPush=true --image-tag-mutability IMMUTABLE"
ARGS+=("--image-scanning-configuration" "scanOnPush=true" "--image-tag-mutability" "IMMUTABLE")
fi

aws "$ECR_CMD" create-repository "$ARGS"
aws "$ECR_CMD" create-repository "${ARGS[@]}"
fi

0 comments on commit 65976db

Please sign in to comment.