Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ install:
script:
- mkdir build
- bash update.sh
- mono nuget.exe pack ./build/Genocs.CleanArchitectureTemplate.nuspec
- mono nuget.exe pack ./build/Genocs.CleanArchitectureTemplate.nuspec -NoDefaultExcludes
- mono nuget.exe setApiKey $NUGET_API_KEY -Source $NUGET_SOURCE
- mono nuget.exe push Genocs.CleanArchitectureTemplate.*.nupkg -Source $NUGET_SOURCE
notifications:
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This tool is usefull to increases productivity on developing your next microserv
The template allow you to use different storage and enterprice service bus.

Allowed storage are:
- InMemmoryDB (for development pourpose)
- InMemoryDB (for development pourpose)
- SqlServer
- MongoDB

Expand All @@ -26,7 +26,7 @@ Managed Enterprise service bus are:
To generate your own Back-end project run:

```sh
dotnet new -i Genocs.CleanArchitectureTemplate::1.8.2
dotnet new -i Genocs.CleanArchitectureTemplate::1.8.3
dotnet new cleanarchitecture -n {MyCompany.MyProject}
cd {MyCompany.MyProject}
dotnet build src\{MyCompany.MyProject}.WebApi
Expand All @@ -49,7 +49,7 @@ To build the package run the following commands:
cd .\src
nuget pack
dotnet new -u Genocs.CleanArchitectureTemplate
dotnet new -i Genocs.CleanArchitectureTemplate.1.8.2.nupkg
dotnet new -i Genocs.CleanArchitectureTemplate.1.8.3.nupkg
dotnet new cleanarchitecture --help
dotnet new cleanarchitecture --name {MyCompany.MyProject} -d mongodb -sb particular
```
Expand Down Expand Up @@ -77,7 +77,6 @@ Read only use cases
dotnet new cleanarchitecture --use-cases readonly
```


## Miscellaneous

How to get the list of installed templates
Expand All @@ -95,7 +94,7 @@ The CI is triggered on `master` branch
Check the `./src/Genocs.CleanArchitectureTemplate.nuspec` and update the node with the correct version.

Keep in mind: NuGet fail to deploy the package in case of version mistake.
``` xml
<version>1.8.2</version>
```

```xml
<version>1.8.3</version>
```
6 changes: 3 additions & 3 deletions src/Genocs.CleanArchitectureTemplate.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="5.0.0">
<id>Genocs.CleanArchitectureTemplate</id>
<version>1.8.2</version>
<version>1.8.3</version>
<authors>Nocco Giovanni Emanuele</authors>
<owners>[Genocs] Nocco Giovanni Emanuele</owners>
<projectUrl>https://github.com/Genocs/clean-architecture-template</projectUrl>
Expand All @@ -16,13 +16,13 @@
</summary>
<description>
Install the package:
$ dotnet new -i Genocs.CleanArchitectureTemplate::1.8.2
$ dotnet new -i Genocs.CleanArchitectureTemplate::1.8.3

The full clean project:
$ dotnet new cleanarchitecture
</description>
<releaseNotes>
- Relesase 1.8.2:
- Relesase 1.8.3:
Added list of events

- Clean Architecture Principles Documentation
Expand Down
3 changes: 0 additions & 3 deletions src/template/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ notifications:
email:
on_success: never
on_failure: always



27 changes: 27 additions & 0 deletions src/template/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["src/Genocs.MicroserviceLight.Template.WebApi/Genocs.MicroserviceLight.Template.WebApi.csproj", "src/Genocs.MicroserviceLight.Template.WebApi/"]
COPY ["src/Genocs.MicroserviceLight.Template.Application/Genocs.MicroserviceLight.Template.Application.csproj", "src/Genocs.MicroserviceLight.Template.Application/"]
COPY ["src/Genocs.MicroserviceLight.Template.Domain/Genocs.MicroserviceLight.Template.Domain.csproj", "src/Genocs.MicroserviceLight.Template.Domain/"]
COPY ["src/Genocs.MicroserviceLight.Template.Shared/Genocs.MicroserviceLight.Template.Shared.csproj", "src/Genocs.MicroserviceLight.Template.Shared/"]
COPY ["src/Genocs.MicroserviceLight.Template.Infrastructure/Genocs.MicroserviceLight.Template.Infrastructure.csproj", "src/Genocs.MicroserviceLight.Template.Infrastructure/"]
RUN dotnet restore "src/Genocs.MicroserviceLight.Template.WebApi/Genocs.MicroserviceLight.Template.WebApi.csproj"
COPY . .
WORKDIR "/src/src/Genocs.MicroserviceLight.Template.WebApi"
RUN dotnet build "Genocs.MicroserviceLight.Template.WebApi.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Genocs.MicroserviceLight.Template.WebApi.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Genocs.MicroserviceLight.Template.WebApi.dll"]
14 changes: 7 additions & 7 deletions src/template/azure-pipelines-docker-acr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pool:

variables:
buildConfiguration: "Release"
imageName: "genocsacr.azurecr.io/keyvaultreader"
imageName: "$(DockerRegistry).azurecr.io/$(DockerImageName)"

stages:
- stage: Build
Expand All @@ -27,18 +27,18 @@ stages:
displayName: "Build the Docker image"
inputs:
containerRegistryType: "Container Registry"
dockerRegistryEndpoint: "genocsacr"
dockerRegistryEndpoint: "$(DockerRegistry)"
command: "Build an image"
dockerFile: "Dockerfile"
arguments: "--build-arg BuildId=$(Build.BuildId) --build-arg PAT=$(PatNugetsFeed)"
arguments: "--build-arg BuildId=$(Build.BuildId)"
includeLatestTag: true
imageName: "$(ImageName)"

- task: Docker@1
displayName: "Push the Docker image to AzureContainerRegistry"
inputs:
containerRegistryType: "Container Registry"
dockerRegistryEndpoint: "genocsacr"
dockerRegistryEndpoint: "$(DockerRegistry)"
command: "Push an image"
imageName: "$(ImageName)"
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
Expand All @@ -47,17 +47,17 @@ stages:
displayName: "Tag-Latest Build the Docker image"
inputs:
containerRegistryType: "Container Registry"
dockerRegistryEndpoint: "genocsacr"
dockerRegistryEndpoint: "$(DockerRegistry)"
command: "Build an image"
dockerFile: "Dockerfile"
arguments: "--build-arg BuildId=$(Build.BuildId) --build-arg PAT=$(PatNugetsFeed)"
arguments: "--build-arg BuildId=$(Build.BuildId)"
imageName: "$(ImageName):$(MajorVer).$(MinorVer).$(Build.BuildId)"

- task: Docker@1
displayName: "Tag-Latest Push the Docker image to AzureContainerRegistry"
inputs:
containerRegistryType: "Container Registry"
dockerRegistryEndpoint: "genocsacr"
dockerRegistryEndpoint: "$(DockerRegistry)"
command: "Push an image"
imageName: "$(ImageName):$(MajorVer).$(MinorVer).$(Build.BuildId)"

Expand Down
8 changes: 4 additions & 4 deletions src/template/azure-pipelines-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pool:

variables:
buildConfiguration: "Release"
imageName: "genocs/keyvaultreader"
imageName: "$(DockerRegistry)/$(DockerImageName)"

stages:
- stage: Build
Expand All @@ -30,7 +30,7 @@ stages:
dockerRegistryEndpoint: "DockerHub"
command: "Build an image"
dockerFile: "Dockerfile"
arguments: "--build-arg BuildId=$(Build.BuildId) --build-arg PAT=$(PatNugetsFeed)"
arguments: "--build-arg BuildId=$(Build.BuildId)"
includeLatestTag: true
imageName: "$(ImageName)"

Expand All @@ -50,11 +50,11 @@ stages:
dockerRegistryEndpoint: "DockerHub"
command: "Build an image"
dockerFile: "Dockerfile"
arguments: "--build-arg BuildId=$(Build.BuildId) --build-arg PAT=$(PatNugetsFeed)"
arguments: "--build-arg BuildId=$(Build.BuildId)"
imageName: "$(ImageName):$(MajorVer).$(MinorVer).$(Build.BuildId)"

- task: Docker@1
displayName: "Tag-Latest Push the Docker image to AzureContainerRegistry"
displayName: "Tag-Latest Push the Docker image to Docker Hub"
inputs:
containerRegistryType: "Container Registry"
dockerRegistryEndpoint: "DockerHub"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Genocs.MicroserviceLight.Template.BusWorker.HostedServices
{
using Infrastructure.ServiceBus;
using Template.Shared.ReadModels;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Shared.ReadModels;
using System;

internal class AzureBusHostService: AzureBusService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
"QueueName": "queue"
},
"ParticularServiceBusSettings": {
"ConnectionString": "host=localhost;username=guest;password=guest;RequestedHeartbeat=600",
"EndpointName": "WebApi"
"EndpointName": "BusWorker",
"TransportConnectionString": "host=localhost;username=guest;password=guest;RequestedHeartbeat=600",
"PersistenceConnectionString": "mongodb://localhost",
"PersistenceDatabase": "ParticularPersistence"
},
"MassTransitSettings": {
"HostName": "hostname",
"VirtualHost": "virtualhost",
"UserName": "username",
"Password": "password"
"HostName": "localhost",
"VirtualHost": "/",
"UserName": "guest",
"Password": "guest"
}
}
}