master
Tudor Stanciu 2021-04-06 02:33:52 +03:00
parent a013136e89
commit faddfee544
20 changed files with 49 additions and 49 deletions

View File

@ -1,6 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
namespace NetworkResurrector.Agent.Application
namespace NetworkResurrector.Api.Application
{
public static class DependencyInjectionExtensions
{

View File

@ -1,8 +1,8 @@
using AutoMapper;
using NetworkResurrector.Agent.Application.Queries;
using NetworkResurrector.Agent.Domain.Entities;
using NetworkResurrector.Api.Application.Queries;
using NetworkResurrector.Api.Domain.Entities;
namespace NetworkResurrector.Agent.Application.Mappings
namespace NetworkResurrector.Api.Application.Mappings
{
public class MappingProfile : Profile
{

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -14,6 +14,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetworkResurrector.Agent.Domain\NetworkResurrector.Agent.Domain.csproj" />
<ProjectReference Include="..\NetworkResurrector.Agent.Domain\NetworkResurrector.Api.Domain.csproj" />
</ItemGroup>
</Project>

View File

@ -1,11 +1,11 @@
using AutoMapper;
using MediatR;
using NDB.Application.DataContracts;
using NetworkResurrector.Agent.Domain.Repositories;
using NetworkResurrector.Api.Domain.Repositories;
using System.Threading;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent.Application.Queries
namespace NetworkResurrector.Api.Application.Queries
{
public class GetMachines
{

View File

@ -1,8 +1,8 @@
using Microsoft.EntityFrameworkCore;
using NetworkResurrector.Agent.Domain.Data.EntityTypeConfiguration;
using NetworkResurrector.Agent.Domain.Entities;
using NetworkResurrector.Api.Domain.Data.EntityTypeConfiguration;
using NetworkResurrector.Api.Domain.Entities;
namespace NetworkResurrector.Agent.Domain.Data.DbContexts
namespace NetworkResurrector.Api.Domain.Data.DbContexts
{
public class AgentDbContext : DbContext
{

View File

@ -1,11 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NetworkResurrector.Agent.Domain.Data.DbContexts;
using NetworkResurrector.Agent.Domain.Data.Repositories;
using NetworkResurrector.Agent.Domain.Repositories;
using NetworkResurrector.Api.Domain.Data.DbContexts;
using NetworkResurrector.Api.Domain.Data.Repositories;
using NetworkResurrector.Api.Domain.Repositories;
namespace NetworkResurrector.Agent.Domain.Data
namespace NetworkResurrector.Api.Domain.Data
{
public static class DependencyInjectionExtensions
{

View File

@ -1,8 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using NetworkResurrector.Agent.Domain.Entities;
using NetworkResurrector.Api.Domain.Entities;
namespace NetworkResurrector.Agent.Domain.Data.EntityTypeConfiguration
namespace NetworkResurrector.Api.Domain.Data.EntityTypeConfiguration
{
class MachineConfiguration : IEntityTypeConfiguration<Machine>
{

View File

@ -9,7 +9,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetworkResurrector.Agent.Domain\NetworkResurrector.Agent.Domain.csproj" />
<ProjectReference Include="..\NetworkResurrector.Agent.Domain\NetworkResurrector.Api.Domain.csproj" />
</ItemGroup>
</Project>

View File

@ -1,10 +1,10 @@
using Microsoft.EntityFrameworkCore;
using NetworkResurrector.Agent.Domain.Data.DbContexts;
using NetworkResurrector.Agent.Domain.Entities;
using NetworkResurrector.Agent.Domain.Repositories;
using NetworkResurrector.Api.Domain.Data.DbContexts;
using NetworkResurrector.Api.Domain.Entities;
using NetworkResurrector.Api.Domain.Repositories;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent.Domain.Data.Repositories
namespace NetworkResurrector.Api.Domain.Data.Repositories
{
class AgentRepository : IAgentRepository
{

View File

@ -1,4 +1,4 @@
namespace NetworkResurrector.Agent.Domain.Entities
namespace NetworkResurrector.Api.Domain.Entities
{
public class Machine
{

View File

@ -1,7 +1,7 @@
using NetworkResurrector.Agent.Domain.Entities;
using NetworkResurrector.Api.Domain.Entities;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent.Domain.Repositories
namespace NetworkResurrector.Api.Domain.Repositories
{
public interface IAgentRepository
{

View File

@ -1,9 +1,9 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using NetworkResurrector.Agent.Application.Queries;
using NetworkResurrector.Api.Application.Queries;
using System.Threading.Tasks;
namespace NetworkResurrector.Agent.Controllers
namespace NetworkResurrector.Api.Controllers
{
[ApiController]
[Route("resurrector-agent")]

View File

@ -9,17 +9,17 @@ WORKDIR /src
COPY dependencies.props .
COPY Directory.Build.props .
COPY NuGet.config .
COPY ["NetworkResurrector.Agent/NetworkResurrector.Agent.csproj", "NetworkResurrector.Agent/"]
COPY ["NetworkResurrector.Agent.Application/NetworkResurrector.Agent.Application.csproj", "NetworkResurrector.Agent.Application/"]
COPY ["NetworkResurrector.Agent.Domain/NetworkResurrector.Agent.Domain.csproj", "NetworkResurrector.Agent.Domain/"]
COPY ["NetworkResurrector.Agent.Domain.Data/NetworkResurrector.Agent.Domain.Data.csproj", "NetworkResurrector.Agent.Domain.Data/"]
RUN dotnet restore "NetworkResurrector.Agent/NetworkResurrector.Agent.csproj"
COPY ["NetworkResurrector.Api/NetworkResurrector.Api.csproj", "NetworkResurrector.Api/"]
COPY ["NetworkResurrector.Api.Application/NetworkResurrector.Api.Application.csproj", "NetworkResurrector.Api.Application/"]
COPY ["NetworkResurrector.Api.Domain/NetworkResurrector.Api.Domain.csproj", "NetworkResurrector.Api.Domain/"]
COPY ["NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj", "NetworkResurrector.Api.Domain.Data/"]
RUN dotnet restore "NetworkResurrector.Api/NetworkResurrector.Api.csproj"
COPY . .
WORKDIR "/src/NetworkResurrector.Agent"
RUN dotnet build "NetworkResurrector.Agent.csproj" -c Release -o /app/build
WORKDIR "/src/NetworkResurrector.Api"
RUN dotnet build "NetworkResurrector.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "NetworkResurrector.Agent.csproj" -c Release -o /app/publish
RUN dotnet publish "NetworkResurrector.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
@ -31,4 +31,4 @@ ENV ConnectionStrings__DatabaseConnection="***REMOVED***"
#Workaround to lower the TLS level in container for old sql server version
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
ENTRYPOINT ["dotnet", "NetworkResurrector.Agent.dll", "--console"]
ENTRYPOINT ["dotnet", "NetworkResurrector.Api.dll", "--console"]

View File

@ -23,8 +23,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NetworkResurrector.Agent.Application\NetworkResurrector.Agent.Application.csproj" />
<ProjectReference Include="..\NetworkResurrector.Agent.Domain.Data\NetworkResurrector.Agent.Domain.Data.csproj" />
<ProjectReference Include="..\NetworkResurrector.Agent.Application\NetworkResurrector.Api.Application.csproj" />
<ProjectReference Include="..\NetworkResurrector.Agent.Domain.Data\NetworkResurrector.Api.Domain.Data.csproj" />
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
namespace NetworkResurrector.Agent
namespace NetworkResurrector.Api
{
public class Program
{

View File

@ -1,6 +1,6 @@
{
"profiles": {
"NetworkResurrector.Agent": {
"NetworkResurrector.Api": {
"commandName": "Project",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {

View File

@ -8,12 +8,12 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NDB.Extensions.Swagger;
using NDB.Security.Authentication.Identity;
using NetworkResurrector.Agent.Application;
using NetworkResurrector.Agent.Domain.Data;
using NetworkResurrector.Api.Application;
using NetworkResurrector.Api.Domain.Data;
using Newtonsoft.Json;
using System.Reflection;
namespace NetworkResurrector.Agent
namespace NetworkResurrector.Api
{
public class Startup
{

View File

@ -31,15 +31,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B0C5F0C1-0BF
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server", "server", "{6889D39C-D8DA-4B99-AFC1-F0B6355E73C0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "agent", "agent", "{43C78941-52E6-4AB8-9170-CC7C006E4784}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{43C78941-52E6-4AB8-9170-CC7C006E4784}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Agent", "NetworkResurrector.Agent\NetworkResurrector.Agent.csproj", "{E10CEE53-8167-446F-BFF3-B80725BB6C90}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Api", "NetworkResurrector.Agent\NetworkResurrector.Api.csproj", "{E10CEE53-8167-446F-BFF3-B80725BB6C90}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Agent.Application", "NetworkResurrector.Agent.Application\NetworkResurrector.Agent.Application.csproj", "{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Api.Application", "NetworkResurrector.Agent.Application\NetworkResurrector.Api.Application.csproj", "{EE31B126-12EC-46B3-8FB4-AD5BCF14C029}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Agent.Domain", "NetworkResurrector.Agent.Domain\NetworkResurrector.Agent.Domain.csproj", "{885D5625-028A-4B35-8C89-7EF718BC6E34}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Api.Domain", "NetworkResurrector.Agent.Domain\NetworkResurrector.Api.Domain.csproj", "{885D5625-028A-4B35-8C89-7EF718BC6E34}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Agent.Domain.Data", "NetworkResurrector.Agent.Domain.Data\NetworkResurrector.Agent.Domain.Data.csproj", "{509767A7-D11C-4143-8D45-01E62DFC2C74}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetworkResurrector.Api.Domain.Data", "NetworkResurrector.Agent.Domain.Data\NetworkResurrector.Api.Domain.Data.csproj", "{509767A7-D11C-4143-8D45-01E62DFC2C74}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -21,7 +21,7 @@ Agent:
Create image:
--from solution folder:
docker image build -t "network-resurrector-agent:1.0.0" -f "NetworkResurrector.Agent/Dockerfile" .
docker image build -t "network-resurrector-agent:1.0.0" -f "NetworkResurrector.Api/Dockerfile" .
Run image:
docker run -p 5053:80 -it network-resurrector-agent:1.0.0