@@ -35,6 +35,8 @@ public class BuildContext : FrostingContext
35
35
public string ReleaseArtifactsDownloadDir { get ; }
36
36
public string UnzippedArtifactsDir { get ; }
37
37
38
+ public UpResult ? PulumiUpResult { get ; set ; }
39
+
38
40
public BuildContext ( ICakeContext context )
39
41
: base ( context )
40
42
{
@@ -139,9 +141,9 @@ public override async Task RunAsync(BuildContext context)
139
141
140
142
context . Log . Information ( $ "Pulumi Up starting...") ;
141
143
142
- var result = await pulumiStack . UpAsync ( ) ;
144
+ context . PulumiUpResult = await pulumiStack . UpAsync ( ) ;
143
145
context . Log . Information ( $ "Pulumi Up completed") ;
144
- Utilities . LogPulumiResult ( context , result ) ;
146
+ Utilities . LogPulumiResult ( context , context . PulumiUpResult ) ;
145
147
}
146
148
}
147
149
@@ -151,7 +153,7 @@ public sealed class RunSeleniumTestsTask : AsyncFrostingTask<BuildContext>
151
153
{
152
154
public override async Task RunAsync ( BuildContext context )
153
155
{
154
- await WriteConfigAsync ( context ) ;
156
+ WriteConfig ( context ) ;
155
157
await RunTestsAsync ( context ) ;
156
158
}
157
159
@@ -171,18 +173,15 @@ private async Task RunTestsAsync(BuildContext context)
171
173
await Task . CompletedTask ;
172
174
}
173
175
174
- private async ValueTask WriteConfigAsync ( BuildContext context )
176
+ private void WriteConfig ( BuildContext context )
175
177
{
176
178
var fullStackName = $ "ProgrammerAL/{ context . PulumiStackName } ";
177
179
178
180
context . Log . Information ( $ "Loading stack { fullStackName } from path '{ context . PulumiPath } ' to get outputs") ;
179
181
180
- var stackArgs = new LocalProgramArgs ( fullStackName , context . PulumiPath ) ;
181
- var pulumiStack = await LocalWorkspace . SelectStackAsync ( stackArgs ) ;
182
- var stackOutputs = await pulumiStack . GetOutputsAsync ( ) ;
182
+ var stackOutputs = context . PulumiUpResult ! . Outputs ;
183
183
var staticSiteEndpoint = stackOutputs [ "StaticSiteHttpsEndpoint" ] . Value . ToString ( ) ?? throw new Exception ( $ "Pulumi output 'StaticSiteHttpsEndpoint' is null for stack '{ fullStackName } '") ;
184
184
185
-
186
185
// Write the config file
187
186
var filePath = $ "{ context . PlaywrightTestsPath } /.runsettings";
188
187
var runsettingsXml = XElement . Load ( filePath ) ;
0 commit comments