Skip to content

Commit

Permalink
Improve arm-template performance
Browse files Browse the repository at this point in the history
  • Loading branch information
moarychan authored and stliu committed Sep 4, 2023
1 parent 91f240e commit b61f508
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions infra/scripts/deploy-jar-to-asa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ declare -a artifact_arr=("admin-server" "customers-service" "vets-service" "visi

az extension add --name spring --upgrade

for item in "${artifact_arr[@]}"
do
jar_file_name="$item-$version.jar"
deployJar() {
jar_file_name="$1-$version.jar"
source_url="$base_url/v$version/$jar_file_name"
# Download binary
echo "Downloading binary from $source_url to $jar_file_name"
Expand All @@ -37,11 +36,20 @@ do
curl -H "Authorization: $auth_header" "$source_url" -o $jar_file_name
fi

config_file_pattern="application,$item"
az spring application-configuration-service bind --resource-group $RESOURCE_GROUP --service $ASA_SERVICE_NAME --app $item
az spring service-registry bind --resource-group $RESOURCE_GROUP --service $ASA_SERVICE_NAME --app $item
az spring app deploy --resource-group $RESOURCE_GROUP --service $ASA_SERVICE_NAME --name $item --artifact-path $jar_file_name --config-file-pattern $config_file_pattern
config_file_pattern="application,$1"
az spring application-configuration-service bind --resource-group $RESOURCE_GROUP --service $ASA_SERVICE_NAME --app $1
az spring service-registry bind --resource-group $RESOURCE_GROUP --service $ASA_SERVICE_NAME --app $1
az spring app deploy --resource-group $RESOURCE_GROUP --service $ASA_SERVICE_NAME --name $1 --artifact-path $jar_file_name --config-file-pattern $config_file_pattern
}

for item in "${artifact_arr[@]}"
do
deployJar $item &
done

wait

echo "Deployed to Azure Spring Cloud successfully."

# Delete uami generated before exiting the script
az identity delete --ids ${AZ_SCRIPTS_USER_ASSIGNED_IDENTITY}

0 comments on commit b61f508

Please sign in to comment.