DEPOLOIMENT

master
Aurian JAULT 3 years ago
parent 67c634ac34
commit 8cd99de388

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

@ -0,0 +1,81 @@
kind: pipeline
type: docker
name: default
trigger:
event:
- push
steps:
- name: build
image: mcr.microsoft.com/dotnet/sdk:6.0
commands:
- cd Sources/
- dotnet restore MySolution.sln
- dotnet build MySolution.sln -c Release --no-restore
- name: tests
image: mcr.microsoft.com/dotnet/sdk:6.0
commands:
- cd Sources/
- dotnet restore MySolution.sln
- dotnet test MySolution.sln --no-restore
depends_on: [build]
- name: code-analysis
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
commands:
- cd Sources/
- dotnet restore MySolution.sln
- dotnet sonarscanner begin /k:$REPO_NAME /d:sonar.host.url=$$$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Tests/**" /d:sonar.login=$$$${PLUGIN_SONAR_TOKEN}
- dotnet build MySolution.sln -c Release --no-restore
- dotnet test MySolution.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
- dotnet publish MySolution.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- dotnet sonarscanner end /d:sonar.login=$$$${PLUGIN_SONAR_TOKEN}
secrets: [ SECRET_SONAR_LOGIN ]
settings:
# accessible en ligne de commande par $${PLUGIN_SONAR_HOST}
sonar_host: https://codefirst.iut.uca.fr/sonar/
# accessible en ligne de commande par $${PLUGIN_SONAR_TOKEN}
sonar_token:
from_secret: SECRET_SONAR_LOGIN
depends_on: [tests]
- name: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
failure: ignore
volumes:
- name: docs
path: /docs
commands:
- /entrypoint.sh
when:
branch:
- master
depends_on: [ build ]
- name: docker-build
image: plugins/docker
settings:
dockerfile: Sources/Dockerfile
context: .
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/my-group/my-application-client
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
when:
branch:
- master
# The volumes declaration appear at the end of the file, after all steps
volumes:
- name: docs
temp: {}

@ -4,6 +4,9 @@
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>b0b030db-9ce6-45da-9caa-5e0e14c1a3f2</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>.</DockerfileContext>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -12,6 +15,8 @@
<PackageReference Include="Blazorise.Bootstrap" Version="1.1.3.1" /> <PackageReference Include="Blazorise.Bootstrap" Version="1.1.3.1" />
<PackageReference Include="Blazorise.DataGrid" Version="1.1.3.1" /> <PackageReference Include="Blazorise.DataGrid" Version="1.1.3.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.1.3.1" /> <PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.1.3.1" />
<PackageReference Include="Elastic.Apm.Extensions.Logging" Version="1.18.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -5,6 +5,8 @@ VisualStudioVersion = 17.4.33103.184
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor", "Blazor.csproj", "{91C123A8-0331-470F-82BF-AF46E9DBADFF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor", "Blazor.csproj", "{91C123A8-0331-470F-82BF-AF46E9DBADFF}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Minecraft.Crafting.Api", "..\Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{C2EE1DDF-F78D-4C2B-8438-8CFD5BF0D7E2}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -15,6 +17,10 @@ Global
{91C123A8-0331-470F-82BF-AF46E9DBADFF}.Debug|Any CPU.Build.0 = Debug|Any CPU {91C123A8-0331-470F-82BF-AF46E9DBADFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91C123A8-0331-470F-82BF-AF46E9DBADFF}.Release|Any CPU.ActiveCfg = Release|Any CPU {91C123A8-0331-470F-82BF-AF46E9DBADFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91C123A8-0331-470F-82BF-AF46E9DBADFF}.Release|Any CPU.Build.0 = Release|Any CPU {91C123A8-0331-470F-82BF-AF46E9DBADFF}.Release|Any CPU.Build.0 = Release|Any CPU
{C2EE1DDF-F78D-4C2B-8438-8CFD5BF0D7E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2EE1DDF-F78D-4C2B-8438-8CFD5BF0D7E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2EE1DDF-F78D-4C2B-8438-8CFD5BF0D7E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2EE1DDF-F78D-4C2B-8438-8CFD5BF0D7E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -8,6 +8,6 @@
@if (Item != null) @if (Item != null)
{ {
@Item.DisplayName <img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName" style="min-width: 64px; max-width: 64px" />
} }
</div> </div>

@ -0,0 +1,23 @@
#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:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Blazor.csproj", "."]
RUN dotnet restore "./Blazor.csproj"
COPY . .
WORKDIR "/src/."
COPY ["nuget.config", "."]
RUN dotnet build "Blazor.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Blazor.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Blazor.dll"]

@ -0,0 +1,10 @@
namespace Blazor
{
public class PositionOptions
{
public const string Position = "Position";
public string Title { get; set; }
public string Name { get; set; }
}
}

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Localization;
using System.Globalization; using System.Globalization;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.Extensions.Logging;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@ -25,10 +26,10 @@ builder.Services
.AddFontAwesomeIcons() .AddFontAwesomeIcons()
.AddBlazoredModal(); .AddBlazoredModal();
builder.Services.AddScoped<IDataService, DataApiService>();
builder.Services.AddBlazoredLocalStorage(); builder.Services.AddBlazoredLocalStorage();
// Add the controller of the app // Add the controller of the app
builder.Services.AddControllers(); builder.Services.AddControllers();
builder.Services.AddScoped<IDataService,DataApiService>();
// Add the localization to the app and specify the resources path // Add the localization to the app and specify the resources path
builder.Services.AddLocalization(opts => { opts.ResourcesPath = "Resources"; }); builder.Services.AddLocalization(opts => { opts.ResourcesPath = "Resources"; });

@ -1,21 +1,13 @@
{ {
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:6913",
"sslPort": 44309
}
},
"profiles": { "profiles": {
"Blazor": { "Blazor": {
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true, "launchBrowser": true,
"applicationUrl": "https://localhost:7027;http://localhost:5027",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} },
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7027;http://localhost:5027"
}, },
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
@ -23,6 +15,21 @@
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true,
"useSSL": true
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:6913",
"sslPort": 44309
} }
} }
} }

@ -1,9 +0,0 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

@ -1,9 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Loading…
Cancel
Save