diff --git a/Makefile b/Makefile index 512e2655..22a9a1ae 100644 --- a/Makefile +++ b/Makefile @@ -14,4 +14,7 @@ pushInPre: packages: make -C src/Yavsc.Abstract pack + make -C src/Yavsc.Server pack + make -C src/Yavsc pack +.PHONY: packages diff --git a/rc-num.txt b/rc-num.txt index 9e22bcb8..75016ea3 100644 --- a/rc-num.txt +++ b/rc-num.txt @@ -1 +1 @@ -02 +03 diff --git a/src/Yavsc.Abstract/Attributes/Validation/YaStringLength.cs b/src/Yavsc.Abstract/Attributes/Validation/YaStringLength.cs index 4250dc4a..bffe5729 100644 --- a/src/Yavsc.Abstract/Attributes/Validation/YaStringLength.cs +++ b/src/Yavsc.Abstract/Attributes/Validation/YaStringLength.cs @@ -26,8 +26,6 @@ namespace Yavsc.Attributes.Validation } } - string errorMessageResourceName; - public override bool IsValid(object value) { if (value == null) { diff --git a/src/cli/Settings/CiBuildSettings.cs b/src/Yavsc.Abstract/IT/CiBuildSettings.cs similarity index 100% rename from src/cli/Settings/CiBuildSettings.cs rename to src/Yavsc.Abstract/IT/CiBuildSettings.cs diff --git a/src/cli/Settings/Command.cs b/src/Yavsc.Abstract/IT/Command.cs similarity index 100% rename from src/cli/Settings/Command.cs rename to src/Yavsc.Abstract/IT/Command.cs diff --git a/src/cli/Settings/CommandPipe.cs b/src/Yavsc.Abstract/IT/CommandPipe.cs similarity index 100% rename from src/cli/Settings/CommandPipe.cs rename to src/Yavsc.Abstract/IT/CommandPipe.cs diff --git a/src/Yavsc.Abstract/Yavsc.Abstract.nuspec b/src/Yavsc.Abstract/Yavsc.Abstract.nuspec index c6c36b9a..48b4891d 100644 --- a/src/Yavsc.Abstract/Yavsc.Abstract.nuspec +++ b/src/Yavsc.Abstract/Yavsc.Abstract.nuspec @@ -6,8 +6,8 @@ $version$ Paul Schneider Paul Schneider - https://github.com/pazof/yavsc/blob/vnext/Yavsc/License.md - https://github.com/pazof/yavsc/README.md + GPL-3.0-or-later + https://github.com/pazof/yavsc/blob/vnext/README.md https://github.com/pazof/yavsc/blob/vnext/Yavsc/wwwroot/images/yavsc.png true diff --git a/src/Yavsc.Server/Models/IT/SourceCode/ProjectBuild.cs b/src/Yavsc.Server/Models/IT/SourceCode/ProjectBuild.cs index 2bad4b29..78a42a2d 100644 --- a/src/Yavsc.Server/Models/IT/SourceCode/ProjectBuild.cs +++ b/src/Yavsc.Server/Models/IT/SourceCode/ProjectBuild.cs @@ -19,23 +19,16 @@ namespace Yavsc.Server.Models.IT.SourceCode // Model annotations => input.Repository!=null => input.Name == input.Repository.Path var prjPath = Path.Combine(WorkingDir, input.Name); var repoInfo = new DirectoryInfo(prjPath); + var makeStart = CreateStartInfo(prjPath); + var args = string.Join(" ", Args); - var cloneStart = new ProcessStartInfo - ( _cmdPath, args ) - { - WorkingDirectory = prjPath, - RedirectStandardOutput = true, - UseShellExecute = false - }; // TODO make `.ansi.log` a defined constant. - var logFile = new FileInfo - ( Path.Combine - ( _repositoryRootPath, $"{input.Name}.ansi.log" )); + var logFile = new FileInfo(Path.Combine(_repositoryRootPath, LogPath)); using (var stream = logFile.Create()) using (var writer = new StreamWriter(stream)) { - var process = Process.Start(cloneStart); + var process = Process.Start(makeStart); // TODO announce ... while (!process.HasExited) { diff --git a/src/Yavsc.Server/Models/IT/SourceCode/SingleCmdProjectBatch.cs b/src/Yavsc.Server/Models/IT/SourceCode/SingleCmdProjectBatch.cs index 1252fcc7..73a7f075 100644 --- a/src/Yavsc.Server/Models/IT/SourceCode/SingleCmdProjectBatch.cs +++ b/src/Yavsc.Server/Models/IT/SourceCode/SingleCmdProjectBatch.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Diagnostics; using System.IO; namespace Yavsc.Server.Models.IT.SourceCode @@ -17,5 +19,18 @@ namespace Yavsc.Server.Models.IT.SourceCode throw new Exception ($"This directory doesn't exist: {WorkingDir},\nand cannot be used as a repository."); } + public ProcessStartInfo CreateStartInfo(string workingDir) + { + var args = string.Join(" ", Args); + var info = new ProcessStartInfo + ( _cmdPath, args ) + { + WorkingDirectory = workingDir ?? WorkingDir, + RedirectStandardOutput = true, + UseShellExecute = false + }; + return info; + } + } } \ No newline at end of file diff --git a/src/Yavsc.Server/Yavsc.Server.nuspec b/src/Yavsc.Server/Yavsc.Server.nuspec index 8c848e3b..debb5085 100644 --- a/src/Yavsc.Server/Yavsc.Server.nuspec +++ b/src/Yavsc.Server/Yavsc.Server.nuspec @@ -9,7 +9,7 @@ $version$ Paul Schneider Paul Schneider - https://github.com/pazof/yavsc/blob/vnext/Yavsc/License.md + GPL-3.0-or-later https://github.com/pazof/yavsc/README.md https://github.com/pazof/yavsc/blob/vnext/Yavsc/wwwroot/images/yavsc.png true diff --git a/src/Yavsc/Yavsc.nuspec b/src/Yavsc/Yavsc.nuspec index 26fce502..ff664a2b 100644 --- a/src/Yavsc/Yavsc.nuspec +++ b/src/Yavsc/Yavsc.nuspec @@ -6,7 +6,7 @@ $version$ Paul Schneider Paul Schneider - https://github.com/pazof/yavsc/blob/vnext/Yavsc/License.md + GPL-3.0-or-later https://github.com/pazof/yavsc/README.md https://github.com/pazof/yavsc/blob/vnext/Yavsc/wwwroot/images/yavsc.png true diff --git a/src/cli/Commands/Builder.cs b/src/cli/Commands/Builder.cs new file mode 100644 index 00000000..05998c5b --- /dev/null +++ b/src/cli/Commands/Builder.cs @@ -0,0 +1,20 @@ +using Yavsc.Server.Models.IT.SourceCode; + +public class Builder { + + + public void Clone() + { + var firstProject = _dbContext.Project.Include(p=>p.Repository).FirstOrDefault(); + Assert.NotNull (firstProject); + var di = new DirectoryInfo(_serverFixture.SiteSetup.GitRepository); + if (!di.Exists) di.Create(); + + + var clone = new GitClone(_serverFixture.SiteSetup.GitRepository); + clone.Launch(firstProject); + gitRepo = di.FullName; + + } + +} \ No newline at end of file diff --git a/src/cli/Commands/Streamer.cs b/src/cli/Commands/Streamer.cs new file mode 100644 index 00000000..0e5eaf48 --- /dev/null +++ b/src/cli/Commands/Streamer.cs @@ -0,0 +1,11 @@ +using System.Net.WebSockets; + +public class Streamer { + private ClientWebSocket _client; + + public Streamer(string token) + { + _client = new ClientWebSocket(); + _client.Options.SetRequestHeader("Authorization", $"Bearer {token}"); + } +} \ No newline at end of file diff --git a/src/cli/project.json b/src/cli/project.json index 20c7d1cf..8fe9490e 100644 --- a/src/cli/project.json +++ b/src/cli/project.json @@ -48,15 +48,15 @@ "Newtonsoft.Json": "9.0.1", "NJsonSchema.CodeGeneration.CSharp": "9.10.65", "Yavsc": { - "version": "1.0.5-rc22", + "version": "1.0.6-rc03", "target": "package" }, "Yavsc.Abstract": { - "version": "1.0.5-rc22", + "version": "1.0.6-rc03", "target": "package" }, "Yavsc.Server": { - "version": "1.0.5-rc22", + "version": "1.0.6-rc03", "target": "package" }, "Microsoft.Dnx.Host": "1.0.0-rc1-final",