diff --git a/Yavsc/Migrations/20180722232456_gitrepo.cs b/Yavsc/Migrations/20180722232456_gitrepo.cs index cb8675c5..33cd8eda 100644 --- a/Yavsc/Migrations/20180722232456_gitrepo.cs +++ b/Yavsc/Migrations/20180722232456_gitrepo.cs @@ -57,6 +57,7 @@ namespace Yavsc.Migrations migrationBuilder.DropForeignKey(name: "FK_Project_ApplicationUser_ClientId", table: "Project"); migrationBuilder.DropForeignKey(name: "FK_Project_PerformerProfile_PerformerId", table: "Project"); migrationBuilder.DropForeignKey(name: "FK_ProjectBuildConfiguration_Project_ProjectId", table: "ProjectBuildConfiguration"); + migrationBuilder.CreateTable( name: "GitRepositoryReference", columns: table => new diff --git a/Yavsc/Services/GitClone.cs b/Yavsc/Services/GitClone.cs index c96700f5..e24e1441 100644 --- a/Yavsc/Services/GitClone.cs +++ b/Yavsc/Services/GitClone.cs @@ -13,6 +13,7 @@ namespace Yavsc.Lib public class GitClone : Batch { string _repositoryRootPath; + string gitPath="git"; public GitClone(string repoRoot) { @@ -28,10 +29,10 @@ namespace Yavsc.Lib // Model annotations => input.Repository!=null => input.Name == input.Repository.Path var prjPath = Path.Combine(WorkingDir, input.Name); var repoInfo = new DirectoryInfo(prjPath); - var gitCmd = repoInfo.Exists ? "pull" : "clone"; + var gitCmd = repoInfo.Exists ? "pull" : "clone --depth=1"; var cloneStart = new ProcessStartInfo - ( gitCmd, $"{gitCmd} {input.Repository.Url} {input.Repository.Path}" ) + ( gitPath, $"{gitCmd} {input.Repository.Url} {input.Repository.Path}" ) { WorkingDirectory = WorkingDir, RedirectStandardOutput = true, @@ -52,7 +53,7 @@ namespace Yavsc.Lib writer.WriteLine(process.StandardOutput.ReadLine()); } } - ResultHandler(true); + if (ResultHandler!=null) ResultHandler(true); } } } diff --git a/Yavsc/project.json b/Yavsc/project.json index b6a317ca..6e84199b 100755 --- a/Yavsc/project.json +++ b/Yavsc/project.json @@ -23,17 +23,17 @@ ] }, "userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f", + "exclude": [ + "wwwroot", + "node_modules", + "bower_components", + "contrib" + ], "buildOptions": { "debugType": "full", "emitEntryPoint": true, "outputName": "Yavsc", "compile": { - "exclude": [ - "wwwroot", - "node_modules", - "bower_components", - "contrib" - ], "include": "*.cs" }, "embed": [ diff --git a/test/appsettings.json b/test/appsettings.json index 682807de..3f7a58b9 100644 --- a/test/appsettings.json +++ b/test/appsettings.json @@ -6,7 +6,8 @@ "Banner": "/images/yavsc.png", "HomeViewName": "Home", "FavIcon": "/favicon.ico", - "Icon": "/images/yavsc.png" + "Icon": "/images/yavsc.png", + "GitRepository": "testingrepo" }, "Logging": { "IncludeScopes": true, diff --git a/test/package-lock.json b/test/package-lock.json index 5f4ef9e7..4c4ec51e 100644 --- a/test/package-lock.json +++ b/test/package-lock.json @@ -3,9 +3,9 @@ "lockfileVersion": 1, "dependencies": { "ansi-to-html": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.6.4.tgz", - "integrity": "sha512-XuUGfj3zOAg3/NCU7Oyf9PaCyFuDVj8dzMqezMycPxo5U52atXt+R4L/zW7ETNA2GTjyj/KGBVEFI8sgPWUu2w==", + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/ansi-to-html/-/ansi-to-html-0.6.6.tgz", + "integrity": "sha512-90M/2sZna3OsoOEbSyXK46poFnlClBC53Rx6etNKQK7iShsX5fI5E/M9Ld6FurtLaxAWLuAPi0Jp8p3y5oAkxg==", "requires": { "entities": "1.1.1" } diff --git a/test/project.json b/test/project.json index 1cc8b46e..efc5d6cc 100644 --- a/test/project.json +++ b/test/project.json @@ -24,7 +24,14 @@ "Chat" ] }, - "tooling": { + "exclude": [ + "testingrepo", + "wwwroot", + "node_modules", + "bower_components", + "contrib" + ], + "tooling": { "defaultNamespace": "test" }, "dependencies": { diff --git a/test/src/YavscDnxUnitTests.cs b/test/src/YavscDnxUnitTests.cs index dcb70100..e39d71bb 100755 --- a/test/src/YavscDnxUnitTests.cs +++ b/test/src/YavscDnxUnitTests.cs @@ -12,7 +12,7 @@ namespace test [Fact] void TestNodeJsForAnsitohtml () { - var procStart = new ProcessStartInfo("nodejs", "node_modules/ansi-to-html/bin/ansi-to-html"); + var procStart = new ProcessStartInfo("node", "node_modules/ansi-to-html/bin/ansi-to-html"); procStart.UseShellExecute = false; procStart.RedirectStandardInput = true; procStart.RedirectStandardOutput = true; @@ -37,6 +37,7 @@ namespace test var encoded = GetStream(proc.StandardOutput); var reader = new StreamReader(encoded); var txt = reader.ReadToEnd(); + Console.WriteLine(txt); } diff --git a/test/src/YavscWorkInProgress.cs b/test/src/YavscWorkInProgress.cs index d3fe30e9..d1511d38 100644 --- a/test/src/YavscWorkInProgress.cs +++ b/test/src/YavscWorkInProgress.cs @@ -6,6 +6,7 @@ using System; using System.Linq; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder.Internal; +using Microsoft.Data.Entity; using Microsoft.Dnx.Compilation.CSharp; using Microsoft.Dnx.Runtime; using Microsoft.Extensions.Configuration; @@ -39,7 +40,7 @@ namespace test var dbc = _serverFixture._app.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext; - var firstProject = dbc.Projects.FirstOrDefault(); + var firstProject = dbc.Projects.Include(p=>p.Repository).FirstOrDefault(); Assert.NotNull (firstProject); var clone = new GitClone(_serverFixture._siteSetup.GitRepository);