Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add microservice quick start template for Azure Spring Apps #13532

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add checking for deployments
  • Loading branch information
moarychan committed Sep 1, 2023
commit bf4143c63b6c4bf4944355bb4ecc037d700685c9
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ $asaServiceName = $env:ASA_SERVICE_NAME

# Fail fast the deployment if envs are empty
if (!$subscriptionId) {
Write-Error "The subscription Id is not successfully retrieved, please retry another deployment."
exit 1
throw "The subscription Id is not successfully retrieved, please retry another deployment."
}
if (!$resourceGroup) {
Write-Error "The resource group is not successfully retrieved, please retry another deployment."
exit 1
throw "The resource group is not successfully retrieved, please retry another deployment."
}
if (!$asaServiceName) {
Write-Error "The Azure Spring Apps service name is not successfully retrieved, please retry another deployment."
exit 1
throw "The Azure Spring Apps service name is not successfully retrieved, please retry another deployment."
}

$apiUrl = 'https://management.azure.com/subscriptions/' + $subscriptionId + '/resourceGroups/' + $resourceGroup + '/providers/Microsoft.AppPlatform/Spring/' + $asaServiceName + '/buildServices/default/builders/default?api-version=2023-05-01-preview'
Expand All @@ -41,6 +38,5 @@ while ($sw.Elapsed -lt $timeout) {
}
Write-Output "State: $state"
if ($state -ne $Succeeded) {
Write-Error "The Build Service Builder provisioning state is not succeeded."
exit 1
throw "The Build Service Builder provisioning state is not succeeded."
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,20 @@ do
deployJar $item &
done

wait
jobs_count=$(jobs -p | wc -l)

# Loop until all jobs are done
while [ $jobs_count -gt 0 ]; do
wait -n
exit_status=$?

if [ $exit_status -ne 0 ]; then
echo "One of the deployment failed with exit status $exit_status"
exit $exit_status
else
jobs_count=$((jobs_count - 1))
fi
done

echo "Deployed to Azure Spring Cloud successfully."

Expand Down
Loading