forked from Baud-UCS/DEF
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Controller is able to send deploy package to agent. Closes Baud-UCS#32
- Loading branch information
Showing
46 changed files
with
790 additions
and
49 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/Agent/DeployAgent/DeployAgent/Data/Json/DeployAgent/sites.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/Server/DeploymentFramework/BusinessLogic.Tests/Services/AgentDeployServiceDebugTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Baud.Deployment.BusinessLogic.Contracts; | ||
using Baud.Deployment.BusinessLogic.Domain.Deployment.Contracts; | ||
using Baud.Deployment.BusinessLogic.Domain.Deployment.Entities; | ||
using Baud.Deployment.BusinessLogic.Providers; | ||
using Baud.Deployment.BusinessLogic.Services; | ||
using FluentAssertions; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NSubstitute; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Tests.Services | ||
{ | ||
[TestClass] | ||
public class AgentDeployServiceDebugTests | ||
{ | ||
////[TestMethod] | ||
public async Task _Debug_ProcessInstallationAsync_Success() | ||
{ | ||
var uow = Substitute.For<IDeploymentUow>(); | ||
var packagesProvider = Substitute.For<IDeployPackagesProvider>(); | ||
packagesProvider.GetPackageBytes(null).ReturnsForAnyArgs(x => File.ReadAllBytes(@"C:\Temp\DEF\Baud.Deploy.HOS-RS-3.3.0.15118.4.nupkg")); | ||
|
||
var service = new AgentDeployService(() => uow, new WebApiAgentAdapterProvider(), packagesProvider); | ||
|
||
var installation = new Installation | ||
{ | ||
DeployTarget = new DeployTarget | ||
{ | ||
Site = new ServerSite | ||
{ | ||
Key = "Test", | ||
Server = new Server | ||
{ | ||
AgentUrl = "http://localhost:9000/" | ||
} | ||
} | ||
} | ||
}; | ||
var result = await service.ProcessInstallationAsync(installation); | ||
|
||
result.Should().Be(Baud.Deployment.BusinessLogic.Domain.Deployment.Enums.InstallationState.Success); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/Server/DeploymentFramework/BusinessLogic.Tests/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="FluentAssertions" version="3.3.0" targetFramework="net451" /> | ||
<package id="NSubstitute" version="1.8.2.0" targetFramework="net451" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Server/DeploymentFramework/BusinessLogic/Contracts/IAgentAdapterProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Contracts | ||
{ | ||
public interface IAgentAdapterProvider | ||
{ | ||
IAgentAdapter CreateAgentAdapter(string agentUrl); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Server/DeploymentFramework/BusinessLogic/Contracts/IDeployPackagesProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Baud.Deployment.BusinessLogic.Domain.Deployment.Models; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Contracts | ||
{ | ||
public interface IDeployPackagesProvider | ||
{ | ||
IQueryable<DeployPackageInfo> GetAvailablePackagesInfo(); | ||
|
||
IQueryable<KeyValuePair<string, string>> GetPackages(); | ||
|
||
IEnumerable<string> GetPackageVersions(string packageId); | ||
|
||
string GetPackageFileFullPath(string packageId, string version); | ||
|
||
byte[] GetPackageBytes(string packageFullPath); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Server/DeploymentFramework/BusinessLogic/Contracts/IDeployService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Baud.Deployment.BusinessLogic.Domain.Deployment.Entities; | ||
using Baud.Deployment.BusinessLogic.Domain.Deployment.Enums; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Contracts | ||
{ | ||
public interface IDeployService | ||
{ | ||
Task<InstallationState> ProcessInstallationAsync(Installation installation); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Server/DeploymentFramework/BusinessLogic/Domain/Deployment/Models/DeployPackageInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Domain.Deployment.Models | ||
{ | ||
public class DeployPackageInfo | ||
{ | ||
public string Id { get; set; } | ||
public string Title { get; set; } | ||
public string Description { get; set; } | ||
|
||
public IEnumerable<string> Versions { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/Server/DeploymentFramework/BusinessLogic/Providers/SimpleCurrentUserProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Baud.Deployment.BusinessLogic.Contracts; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Providers | ||
{ | ||
public class SimpleCurrentUserProvider : ICurrentUserProvider | ||
{ | ||
private readonly int _userID; | ||
|
||
public SimpleCurrentUserProvider(int userID) | ||
{ | ||
_userID = userID; | ||
} | ||
|
||
public int GetCurrentUserID() | ||
{ | ||
return _userID; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Server/DeploymentFramework/BusinessLogic/Providers/WebApiAgentAdapterProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Baud.Deployment.BusinessLogic.Agents; | ||
using Baud.Deployment.BusinessLogic.Contracts; | ||
|
||
namespace Baud.Deployment.BusinessLogic.Providers | ||
{ | ||
public class WebApiAgentAdapterProvider : IAgentAdapterProvider | ||
{ | ||
public IAgentAdapter CreateAgentAdapter(string agentUrl) | ||
{ | ||
return new WebApiAgentAdapter(agentUrl); | ||
} | ||
} | ||
} |
Oops, something went wrong.