Skip to content

Commit

Permalink
VCI-830: Minor fixes (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro authored Feb 20, 2024
1 parent 97a4c54 commit 1100712
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/VirtoCommerce.Build/Cloud/Build.SaaS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ internal partial class Build
[Parameter("Organization name", Name = "Organization")] public string SaaSOrganizationName { get; set; }

public Target WaitForStatus => _ => _
.Executes(() => Log.Warning("Target WaitForStatus is obsolete. Use CloudEnvStatus."))
.Triggers(CloudEnvStatus);
public Target CloudEnvStatus => _ => _
.Executes(async () =>
{
var isSuccess = false;
Expand All @@ -89,6 +92,10 @@ internal partial class Build
});

public Target SetEnvParameter => _ => _
.Executes(() => Log.Warning("Target SetEnvParameter is obsolete. Use CloudEnvSetParameter."))
.Triggers(CloudEnvSetParameter);

public Target CloudEnvSetParameter => _ => _
.Executes(async () =>
{
var cloudClient = new VirtoCloudClient(CloudUrl, await GetCloudTokenAsync());
Expand All @@ -102,8 +109,11 @@ internal partial class Build
await cloudClient.UpdateEnvironmentAsync(env);
});

public Target UpdateCloudEnvironment => _ => _
.Executes(() => Log.Warning("Target UpdateCloudEnvironment is obsolete. Use CloudEnvUpdate."))
.Triggers(CloudEnvUpdate);

public Target CloudEnvUpdate => _ => _
.Executes(async () =>
{
var cloudClient = new VirtoCloudClient(CloudUrl, await GetCloudTokenAsync());
Expand Down Expand Up @@ -259,7 +269,6 @@ private static void CopyPlatformDirectory(AbsolutePath platformDirectory, Absolu
var listener = new HttpListener() {
Prefixes = { listenerPrefix }
};
Log.Information("Start listening to {0}", listenerPrefix);
listener.Start();
Expand All @@ -270,7 +279,8 @@ private static void CopyPlatformDirectory(AbsolutePath platformDirectory, Absolu
var context = await listener.GetContextAsync();
context.Response.StatusCode = (int)HttpStatusCode.OK;
var apiKey = context.Request.QueryString["apiKey"];
context.Response.Close(Encoding.UTF8.GetBytes("You can close this browser tab now."), false);
context.Response.Redirect($"{CloudUrl}/vcbuild/login/success");
context.Response.Close();
SaveCloudToken(apiKey);
});
Expand Down

0 comments on commit 1100712

Please sign in to comment.