Skip to content

Commit ccf9e39

Browse files
committed
destroy terraform resources after each test
1 parent 68327f8 commit ccf9e39

5 files changed

Lines changed: 25 additions & 1 deletion

File tree

  • samples
    • function-app-managed-identity/python/terraform
    • function-app-storage-http/dotnet/terraform
    • web-app-cosmosdb-mongodb-api/python/terraform
    • web-app-managed-identity/python/terraform
    • web-app-sql-database/python/terraform

samples/function-app-managed-identity/python/terraform/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,8 @@ fi
132132
if [ -f "$ZIPFILE" ]; then
133133
rm "$ZIPFILE"
134134
fi
135+
136+
# Clean up Terraform resources
137+
echo "Cleaning up Terraform resources..."
138+
cd "$CURRENT_DIR" || exit
139+
$TERRAFORM destroy -auto-approve

samples/function-app-storage-http/dotnet/terraform/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,8 @@ $AZ functionapp deploy \
115115
--name "$FUNCTION_APP_NAME" \
116116
--src-path $ZIPFILE \
117117
--type zip 1> /dev/null
118+
119+
# Clean up Terraform resources
120+
echo "Cleaning up Terraform resources..."
121+
cd "$CURRENT_DIR" || exit
122+
$TERRAFORM destroy -auto-approve

samples/web-app-cosmosdb-mongodb-api/python/terraform/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,8 @@ $AZ webapp deploy \
118118
if [ -f "$ZIPFILE" ]; then
119119
rm "$ZIPFILE"
120120
fi
121+
122+
# Clean up Terraform resources
123+
echo "Cleaning up Terraform resources..."
124+
cd "$CURRENT_DIR" || exit
125+
$TERRAFORM destroy -auto-approve

samples/web-app-managed-identity/python/terraform/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,8 @@ fi
130130
if [ -f "$ZIPFILE" ]; then
131131
rm "$ZIPFILE"
132132
fi
133+
134+
# Clean up Terraform resources
135+
echo "Cleaning up Terraform resources..."
136+
cd "$CURRENT_DIR" || exit
137+
$TERRAFORM destroy -auto-approve

samples/web-app-sql-database/python/terraform/deploy.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,12 @@ else
284284
exit 1
285285
fi
286286

287-
# Remove the zip package of the web app
288287
# Remove the zip package of the web app
289288
if [ -f "$ZIPFILE" ]; then
290289
rm "$ZIPFILE"
291290
fi
291+
292+
# Clean up Terraform resources
293+
echo "Cleaning up Terraform resources..."
294+
cd "$CURRENT_DIR" || exit
295+
$TERRAFORM destroy -auto-approve

0 commit comments

Comments
 (0)