Skip to content

Commit

Permalink
VCI-751: Fix for DeployImage target (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro authored Nov 13, 2023
1 parent 6a3499d commit 839e6af
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/VirtoCommerce.Build/Cloud/Build.SaaS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,16 @@ private static bool CheckAppServiceStatus(string expected, string actual)
var modulesPath = platformDirectory / "modules";
var dockerfilePath = dockerBuildContext / "Dockerfile";

FileSystemTasks.EnsureCleanDirectory(dockerBuildContext);

await HttpTasks.HttpDownloadFileAsync(DockerfileUrl, dockerfilePath);

var modulesSourcePath = Solution?.Path != null
? WebProject.Directory / "modules"
: RootDirectory / "modules";

// Copy the platform
if (Solution != null)
if (Solution?.Path != null)
{
DotNetTasks.DotNetPublish(settings => settings
.SetConfiguration(Configuration)
Expand All @@ -129,11 +135,25 @@ private static bool CheckAppServiceStatus(string expected, string actual)
}
else
{
FileSystemTasks.CopyDirectoryRecursively(RootDirectory, platformDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer, d => !d.FullName.EndsWith("modules"));
var nukeDir = Path.Combine(RootDirectory, ".nuke");
var directories = Directory.GetDirectories(RootDirectory).Where(d => !PathConstruction.IsDescendantPath(modulesSourcePath, d)
&& !PathConstruction.IsDescendantPath(nukeDir, d)
&& !PathConstruction.IsDescendantPath(ArtifactsDirectory, d)).ToArray();
var files = Directory.GetFiles(RootDirectory);

foreach ( var dir in directories)
{
FileSystemTasks.CopyDirectoryRecursively(dir, platformDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer);
}

foreach( var file in files)
{
FileSystemTasks.CopyFileToDirectory(file, platformDirectory);
}
}

// Copy modules
var modulesDirectories = Directory.EnumerateDirectories(WebProject.Directory / "modules");
var modulesDirectories = Directory.EnumerateDirectories(modulesSourcePath);
foreach (var directory in modulesDirectories)
{
var webProjects = Directory.EnumerateFiles(directory, $"*.Web.csproj");
Expand Down

0 comments on commit 839e6af

Please sign in to comment.