Skip to content

Commit

Permalink
VCI-834: Make DockerfileUrl parameter; Add WaitScriptUrl parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro committed Feb 23, 2024
1 parent cb7649a commit 6769f1b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/VirtoCommerce.Build/Cloud/Build.SaaS.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Policy;
using System.Text.Json.Nodes;
using System.Text;
using System.Net;
using System.Threading.Tasks;
using Cloud.Client;
using Cloud.Models;
using Microsoft.TeamFoundation.Build.WebApi;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
Expand All @@ -19,10 +16,6 @@
using Serilog;
using VirtoCloud.Client.Api;
using VirtoCloud.Client.Model;
using System.Net;
using System.Diagnostics;
using Microsoft.AspNetCore.Identity;
using System.Runtime.InteropServices;

namespace VirtoCommerce.Build;

Expand Down Expand Up @@ -65,6 +58,13 @@ internal partial class Build

[Parameter("Organization name", Name = "Organization")] public string SaaSOrganizationName { get; set; }



[Parameter("Url to Dockerfile which will use to build the docker image in the CloudDeploy/CloudUp Target")]
public static string DockerfileUrl { get; set; } = "https://raw.githubusercontent.com/VirtoCommerce/vc-docker/feat/net8/linux/platform/Dockerfile";
[Parameter("Url to Wake-script which will use to build the docker image in the CloudDeploy/CloudUp Target")]
public static string WaitScriptUrl { get; set; } = "https://raw.githubusercontent.com/VirtoCommerce/vc-docker/feat/net8/linux/platform/wait-for-it.sh";

public Target WaitForStatus => _ => _
.Executes(() => Log.Warning("Target WaitForStatus is obsolete. Use CloudEnvStatus."))
.Triggers(CloudEnvStatus);
Expand Down Expand Up @@ -130,8 +130,6 @@ private static bool CheckAppServiceStatus(string expected, string actual)

return false;
}

public static string DockerfileUrl { get; set; } = "https://raw.githubusercontent.com/krankenbro/vc-ci-test/master/Dockerfile";
public Target PrepareDockerContext => _ => _
.Before(InitPlatform, DockerLogin, BuildImage, PushImage, BuildAndPush)
.Triggers(InitPlatform)
Expand All @@ -143,10 +141,12 @@ private async Task PrepareDockerContextMethod()
var platformDirectory = dockerBuildContext / "platform";
var modulesPath = platformDirectory / "modules";
var dockerfilePath = dockerBuildContext / "Dockerfile";
var waitScriptPath = dockerBuildContext / "wait-for-it.sh";

FileSystemTasks.EnsureCleanDirectory(dockerBuildContext);

await HttpTasks.HttpDownloadFileAsync(DockerfileUrl, dockerfilePath);
await HttpTasks.HttpDownloadFileAsync(WaitScriptUrl, waitScriptPath);

var modulesSourcePath = Solution?.Path != null
? WebProject.Directory / "modules"
Expand Down

0 comments on commit 6769f1b

Please sign in to comment.