Skip to content

Commit 55b113f

Browse files
authored
feat: added 'NO_IMAGE' skip towards task definition image injection (#8)
* feat: added NO_IMAGE check * chore: added comment on why NO_IMAGE check
1 parent 24a0c50 commit 55b113f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

deploy.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,13 @@ function modifyTaskDefinitionFile() {
138138
exit 1;
139139
fi
140140

141-
touch tmpfile;
141+
# Intentional skip when NO_IMAGE received to keep above error checking for empty image string
142+
if [[ "$IMAGE" != "NO_IMAGE" ]]; then
143+
touch tmpfile;
142144

143-
# shellcheck disable=SC2002
144-
cat "$TASK_DEFINITION_FILE" | jq --arg image "$IMAGE" --arg container "$CONTAINER" '(.containerDefinitions[]? | select(.name==$container)) |= (.image=$image)' > tmpfile && mv tmpfile "$TASK_DEFINITION_FILE"
145+
# shellcheck disable=SC2002
146+
cat "$TASK_DEFINITION_FILE" | jq --arg image "$IMAGE" --arg container "$CONTAINER" '(.containerDefinitions[]? | select(.name==$container)) |= (.image=$image)' > tmpfile && mv tmpfile "$TASK_DEFINITION_FILE"
147+
fi
145148
done
146149

147150
if jq < "$TASK_DEFINITION_FILE" &> /dev/null; then

0 commit comments

Comments
 (0)