1
+ <Project ToolsVersion =" Current" DefaultTargets =" smoke-tests" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
2
+ <PropertyGroup >
3
+ <RootPath Condition =" '$(RootPath)'==''" >$(MSBuildProjectDirectory)</RootPath >
4
+
5
+ <!-- We need to skip recipes that use Docker when running on Windows CodeBuild -->
6
+ <ShouldRunDockerTests >false</ShouldRunDockerTests >
7
+ <ShouldRunDockerTests Condition =" '$(OS)' != 'Windows_NT' OR '$(CODEBUILD_BUILD_ID)' == ''" >true</ShouldRunDockerTests >
8
+
9
+ <!-- Generate a suffix for CloudFormation stack names, in case multiple smoke tests are running at once -->
10
+ <SafeOperatingSystem >$(OS)</SafeOperatingSystem >
11
+ <SafeOperatingSystem Condition =" '$(OS)' == 'Windows_NT'" >Windows</SafeOperatingSystem > <!-- need to remove _ for CloudFormation-->
12
+ <Suffix >$(SafeOperatingSystem)-$([System.DateTimeOffset]::UtcNow.ToUnixTimeSeconds())</Suffix >
13
+
14
+ <BlazorAppName >CanaryBlazorApp-$(Suffix)</BlazorAppName >
15
+ <ECSFargateAppName >CanaryECSFargateApp-$(Suffix)</ECSFargateAppName >
16
+ <AppRunnerAppName >CanaryAppRunnerApp-$(Suffix)</AppRunnerAppName >
17
+ <BeanstalkWindowsAppName >CanaryEBWinApp-$(Suffix)</BeanstalkWindowsAppName >
18
+ <BeanstalkLinuxAppName >CanaryEBLinuxApp-$(Suffix)</BeanstalkLinuxAppName >
19
+ <PushImageECRAppName >CanaryEBWinApp-$(Suffix)</PushImageECRAppName >
20
+ <BeanstalkLinuxAppName >CanaryEBLinuxApp-$(Suffix)</BeanstalkLinuxAppName >
21
+ <ECSServiceAppName >CanaryECSServiceApp-$(Suffix)</ECSServiceAppName >
22
+ </PropertyGroup >
23
+
24
+ <Target Name =" smoke-tests" DependsOnTargets =" run-blazor;run-fargate;run-apprunner;run-beanstalk-windows;run-beanstalk-linux;run-container-ecr;run-ecs-service" />
25
+
26
+ <Target Name =" initialize" >
27
+ <!-- Install the latest version of the deploy tool-->
28
+ <Exec Command =" dotnet tool install -g aws.deploy.tools" />
29
+ </Target >
30
+
31
+ <Target Name =" run-blazor" DependsOnTargets =" initialize" >
32
+ <Exec WorkingDirectory =" ../testapps/BlazorWasm60" Command =" dotnet aws deploy --apply apply-settings.json --application-name $(BlazorAppName) --profile test-runner --silent" />
33
+ <OnError ExecuteTargets =" cleanup-blazor" />
34
+ </Target >
35
+
36
+ <Target Name =" cleanup-blazor" AfterTargets =" run-blazor" >
37
+ <Exec Command =" dotnet aws delete-deployment $(BlazorAppName) --profile test-runner --silent" />
38
+ </Target >
39
+
40
+ <Target Name =" run-fargate" Condition =" '$(ShouldRunDockerTests)' == 'true'" DependsOnTargets =" initialize" >
41
+ <Exec WorkingDirectory =" ../testapps/WebAppWithDockerFile" Command =" dotnet aws deploy --apply ../../buildtools/canarysettings/ECSFargateCanary.json --application-name $(ECSFargateAppName) --profile test-runner --silent" />
42
+ <OnError ExecuteTargets =" cleanup-fargate" />
43
+ </Target >
44
+
45
+ <Target Name =" cleanup-fargate" Condition =" '$(ShouldRunDockerTests)' == 'true'" AfterTargets =" run-fargate" >
46
+ <Exec Command =" dotnet aws delete-deployment $(ECSFargateAppName) --profile test-runner --silent" />
47
+ </Target >
48
+
49
+ <Target Name =" run-apprunner" Condition =" '$(ShouldRunDockerTests)' == 'true'" DependsOnTargets =" initialize" >
50
+ <Exec WorkingDirectory =" ../testapps/WebAppWithDockerFile" Command =" dotnet aws deploy --apply ../../buildtools/canarysettings/AppRunnerCanary.json --application-name $(AppRunnerAppName) --profile test-runner --silent" />
51
+ <OnError ExecuteTargets =" cleanup-apprunner" />
52
+ </Target >
53
+
54
+ <Target Name =" cleanup-apprunner" Condition =" '$(ShouldRunDockerTests)' == 'true'" AfterTargets =" run-apprunner" >
55
+ <Exec Command =" dotnet aws delete-deployment $(AppRunnerAppName) --profile test-runner --silent" />
56
+ </Target >
57
+
58
+ <Target Name =" run-beanstalk-windows" DependsOnTargets =" initialize" >
59
+ <Exec WorkingDirectory =" ../testapps/WebAppNoDockerFile" Command =" dotnet aws deploy --apply ElasticBeanStalkConfigFile-Windows.json --application-name $(BeanstalkWindowsAppName) --profile test-runner --silent" />
60
+ <OnError ExecuteTargets =" cleanup-beanstalk-windows" />
61
+ </Target >
62
+
63
+ <Target Name =" cleanup-beanstalk-windows" AfterTargets =" run-beanstalk-windows" >
64
+ <Exec Command =" dotnet aws delete-deployment $(BeanstalkWindowsAppName) --profile test-runner --silent" />
65
+ </Target >
66
+
67
+ <Target Name =" run-beanstalk-linux" DependsOnTargets =" initialize" >
68
+ <Exec WorkingDirectory =" ../testapps/WebAppNoDockerFile" Command =" dotnet aws deploy --apply ElasticBeanStalkConfigFile-Linux.json --application-name $(BeanstalkLinuxAppName) --profile test-runner --silent" />
69
+ <OnError ExecuteTargets =" cleanup-beanstalk-linux" />
70
+ </Target >
71
+
72
+ <Target Name =" cleanup-beanstalk-linux" AfterTargets =" run-beanstalk-linux" >
73
+ <Exec Command =" dotnet aws delete-deployment $(BeanstalkLinuxAppName) --profile test-runner --silent" />
74
+ </Target >
75
+
76
+ <Target Name =" run-container-ecr" Condition =" '$(ShouldRunDockerTests)' == 'true'" DependsOnTargets =" initialize" >
77
+ <Exec WorkingDirectory =" ../testapps/ConsoleAppTask" Command =" dotnet aws deploy --apply ../../buildtools/canarysettings/PushContainerImageCanary.json --profile test-runner --silent" />
78
+ <!-- This one doesn't have a cleanup step since it doesn't use CloudFormation -->
79
+ </Target >
80
+
81
+ <Target Name =" run-ecs-service" Condition =" '$(ShouldRunDockerTests)' == 'true'" DependsOnTargets =" " >
82
+ <Exec WorkingDirectory =" ../testapps/ConsoleAppService" Command =" dotnet aws deploy --apply ../../buildtools/canarysettings/ECSServiceCanary.json --application-name $(ECSServiceAppName) --profile test-runner --silent" />
83
+ <OnError ExecuteTargets =" cleanup-ecs-service" />
84
+ </Target >
85
+
86
+ <Target Name =" cleanup-ecs-service" Condition =" '$(ShouldRunDockerTests)' == 'true'" AfterTargets =" run-ecs-service" >
87
+ <Exec Command =" dotnet aws delete-deployment $(ECSServiceAppName) --profile test-runner --silent" />
88
+ </Target >
89
+
90
+ </Project >
0 commit comments