Skip to content

Commit

Permalink
use unique folder per channel, clean up when done
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats committed Feb 18, 2024
1 parent 7fff4f5 commit cb8bed3
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions Plogon/BuildProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,13 @@ public async Task<BuildResult> ProcessTask(BuildTask task, bool commit, string?

ParanoiaValidateTask(task);

var folderName = $"{task.InternalName}-{task.Manifest.Plugin.Commit}";
var work = this.workFolder.CreateSubdirectory($"{folderName}-work");
var archive = this.workFolder.CreateSubdirectory($"{folderName}-archive");
var output = this.workFolder.CreateSubdirectory($"{folderName}-output");
var packages = this.workFolder.CreateSubdirectory($"{folderName}-packages");
var needs = this.workFolder.CreateSubdirectory($"{folderName}-needs");
var taskFolderName = $"{task.InternalName}-{task.Manifest.Plugin.Commit}-{task.Channel}";
var taskRoot = this.workFolder.CreateSubdirectory(taskFolderName);
var work = taskRoot.CreateSubdirectory("work");
var archive = taskRoot.CreateSubdirectory("archive");
var output = taskRoot.CreateSubdirectory("output");
var packages = taskRoot.CreateSubdirectory("packages");
var needs = taskRoot.CreateSubdirectory("needs");

Debug.Assert(staticFolder.Exists);

Expand Down Expand Up @@ -1118,6 +1119,16 @@ await this.dockerClient.Containers.RemoveContainerAsync(containerCreateResponse.
throw new Exception("DalamudPackager output not found, make sure it is installed");
}

try
{
// Cleanup work folder to save storage space on actions
work.Delete(true);
}
catch (Exception ex)
{
Log.Error(ex, "Could not cleanup workspace");
}

return new BuildResult(exitCode == 0, diff, version, task);
}

Expand Down

0 comments on commit cb8bed3

Please sign in to comment.