From 5648f69af143d1f477684b8d5430323dc919e780 Mon Sep 17 00:00:00 2001 From: Graham Savage Date: Mon, 16 Mar 2026 09:29:55 +0000 Subject: [PATCH 1/3] Only support staging account in AWS Include The AWS include script is part of our larger tooling, but within this repository it is only used to download images from our "staging" ECRs. This commit removes other environments and removes some dead code. --- bin/aws_include.sh | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/bin/aws_include.sh b/bin/aws_include.sh index b50929e19..038b2ddef 100755 --- a/bin/aws_include.sh +++ b/bin/aws_include.sh @@ -1,24 +1,9 @@ # The POSSIBLE_AWS_SERVERS names must match the [profile ] in # ~/.aws/config -POSSIBLE_AWS_SERVERS='staging|azure|prod|dnb|stacc|modulr' +POSSIBLE_AWS_SERVERS='staging' AWS_VAULT_ENV_FILE_BASE=~/.aws/aws_vault_env S3_PATH_STAGING="s3://merkely-temp" -S3_PATH_PROD="s3://merkely-prod-temp" -S3_PATH_DNB="s3://merkely-dnb-temp" -S3_PATH_STACC="s3://merkely-stacc-temp" -S3_PATH_MODULR="s3://merkely-modulr-temp" - -## Disabled for now since Ewelinca has bash version 3.x.x -## Bash associative array -#declare -A S3_PATHS -#S3_PATHS[staging]="s3://merkely-temp" -##S3_PATHS[azure]= -#S3_PATHS[prod]="s3://merkely-prod-temp" -#S3_PATHS[dnb]="s3://merkely-dnb-temp" -#S3_PATHS[stacc]="s3://merkely-stacc-temp" -#S3_PATHS[modulr]="s3://merkely-modulr-temp" - # Notes about AWS tools. # For commands that execute 'aws ecs' commands it is necessary @@ -187,15 +172,3 @@ get_s3_path() ;; esac } - -## Disabled for now since Ewelinca has bash version 3.x.x -#get_s3_path() -#{ -# local awsServerName=$1; shift -# if [ ${S3_PATHS[$awsServerName]+_} ]; then -# echo ${S3_PATHS[$awsServerName]} -# return 0 -# else -# return 1 -# fi -#} From c504dccb54d44f4165737fd4692c6252909abc4d Mon Sep 17 00:00:00 2001 From: Graham Savage Date: Mon, 16 Mar 2026 09:32:25 +0000 Subject: [PATCH 2/3] Use "env" to local the correct bash binary On MacOS 26, running /bin/bash will run version 3.2 of Bash. We need a later version in order to use the centrally-managed aws-include file, so in this commit I've updated the hash-bang line to use "env" - on my machine this loads bash v5. --- bin/docker_login_aws.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/docker_login_aws.sh b/bin/docker_login_aws.sh index 67435c43e..399332f5f 100755 --- a/bin/docker_login_aws.sh +++ b/bin/docker_login_aws.sh @@ -1,4 +1,5 @@ -#!/bin/bash -Eeu +#!/usr/bin/env bash +set -Eeu SCRIPT_NAME=docker_login_aws.sh HELP_STRING="Does a docker login to AWS so we can fetch repositories from it" From 112c437483a175dcc25348a45583a4660752a49e Mon Sep 17 00:00:00 2001 From: Graham Savage Date: Mon, 16 Mar 2026 09:55:22 +0000 Subject: [PATCH 3/3] Use the centrally managed AWS Include file Update the docker-login script to use the aws include from the "Server" repo so that we can manage it centrally and reduce duplication. There is one use-case within CI, and that cannot use the centrally-managed repo, so I've added conditional logic here to detect if we're running in CI. --- bin/docker_login_aws.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/docker_login_aws.sh b/bin/docker_login_aws.sh index 399332f5f..a11f1cd55 100755 --- a/bin/docker_login_aws.sh +++ b/bin/docker_login_aws.sh @@ -4,7 +4,12 @@ set -Eeu SCRIPT_NAME=docker_login_aws.sh HELP_STRING="Does a docker login to AWS so we can fetch repositories from it" SCRIPT_DIR=$(dirname $(readlink -f $0)) -source ${SCRIPT_DIR}/aws_include.sh + +if [ -n "${CI:-}" ]; then + source ${SCRIPT_DIR}/aws_include.sh +else + source ${SCRIPT_DIR}/../../server/bin/aws_include.sh +fi get_aws_account_id() {