Skip to content

Commit

Permalink
make suffixes align, add comment on parameter expansion in bash
Browse files Browse the repository at this point in the history
  • Loading branch information
kenoir committed Jan 9, 2025
1 parent e032729 commit 5f6ee6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions builds/deploy_catalogue_pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ then

echo "Deploying λ pipeline services to catalogue-$PIPELINE_DATE"
"$ROOT/builds/deploy_lambda_services.sh" \
r_embed_batcher:batcher \
r_embed_embedder:relation_embedder
batcher:r_embed_batcher \
relation_embedder:r_embed_embedder
fi

8 changes: 6 additions & 2 deletions builds/deploy_lambda_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ REPOSITORY_URI="760097843905.dkr.ecr.eu-west-1.amazonaws.com"

for FUNCTION_SUFFIX_IMAGE_NAME_PAIR in "$@"
do
FUNCTION_SUFFIX="${FUNCTION_SUFFIX_IMAGE_NAME_PAIR%:*}"
IMAGE_NAME="${FUNCTION_SUFFIX_IMAGE_NAME_PAIR#*:}"
# See https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
# for an explanation of the syntax used here.
# %:* removes the shortest matching pattern of "colon followed by any characters"
# #*: removes the shortest matching pattern of "any characters followed by a colon"
IMAGE_NAME="${FUNCTION_SUFFIX_IMAGE_NAME_PAIR%:*}"
FUNCTION_SUFFIX="${FUNCTION_SUFFIX_IMAGE_NAME_PAIR#*:}"

IMAGE_URI="${REPOSITORY_URI}"/uk.ac.wellcome/"${IMAGE_NAME}":"env.${PIPELINE_DATE}"
FUNCTION_NAME="${PIPELINE_NAMESPACE}"-"${FUNCTION_SUFFIX}"
Expand Down

0 comments on commit 5f6ee6e

Please sign in to comment.