Skip to content

Commit

Permalink
fix: fix npm run build when aws configure not set
Browse files Browse the repository at this point in the history
  • Loading branch information
IcyKallen committed Jan 6, 2025
1 parent 59cc55b commit 42552e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions source/model/etl/code/model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
dockerfile=$1
image=$2
tag=$3 # New argument for the tag
aws_region=$4

if [ "$image" = "" ] || [ "$dockerfile" = "" ] || [ "$tag" = "" ]
if [ "$image" = "" ] || [ "$dockerfile" = "" ] || [ "$tag" = "" ] || [ "$aws_region" = "" ]
then
echo "Usage: \$0 <docker-file> <image-name> <tag>"
echo "Usage: \$0 <docker-file> <image-name> <tag> <aws-region>"
exit 1
fi

# Get the account number associated with the current IAM credentials
account=$(aws sts get-caller-identity --query Account --output text)
aws_region=$(aws configure get region)

echo "Account: $account"
echo "Region: $aws_region"
Expand Down
3 changes: 2 additions & 1 deletion source/script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

# Load config.json
config_file="../infrastructure/bin/config.json"
deploy_region=$(jq -r '.deployRegion' $config_file)
knowledge_base_enabled=$(jq -r '.knowledgeBase.enabled' $config_file)
knowledge_base_intelliagent_enabled=$(jq -r '.knowledgeBase.knowledgeBaseType.intelliAgentKb.enabled' $config_file)
knowledge_base_models_enabled=$(jq -r '.knowledgeBase.knowledgeBaseType.intelliAgentKb.knowledgeBaseModel.enabled' $config_file)
Expand Down Expand Up @@ -31,7 +32,7 @@ aws ecr-public get-login-password --region us-east-1 | docker login --username A
prepare_etl_model() {
echo "Preparing ETL Model"
cd model/etl/code
sh model.sh ./Dockerfile $ecr_repository $ecr_image_tag
sh model.sh ./Dockerfile $ecr_repository $ecr_image_tag $deploy_region
cd - > /dev/null
pwd
}
Expand Down

0 comments on commit 42552e9

Please sign in to comment.