Compare commits

..

3 Commits

Author SHA1 Message Date
Antoine JOURDAIN b8e1f9b759 Mise à jour de 'README.md'
continuous-integration/drone/push Build was killed Details
1 year ago
Antoine JOURDAIN 777e985cc4 Ajout MS Project
continuous-integration/drone/push Build is passing Details
1 year ago
Patrick BRUGIERE 59529cfac1 Ajout des rapport d'activités
continuous-integration/drone/push Build is passing Details
1 year ago

@ -1,70 +1,42 @@
kind: pipeline
type: docker
name: API
name: default
trigger:
branch:
- WebAPI
event:
- push
steps:
- name: build
image: mcr.microsoft.com/dotnet/sdk:8.0
image: mcr.microsoft.com/dotnet/sdk:7.0
commands:
- cd Project/EntityFramework/
- dotnet restore webAPI.sln
- dotnet build webAPI.sln -c Release --no-restore
- dotnet publish webAPI.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- cd Project/adminBlazor/
- dotnet restore adminBlazor.sln
- dotnet build adminBlazor.sln -c Release --no-restore
- name: tests
image: mcr.microsoft.com/dotnet/sdk:8.0
image: mcr.microsoft.com/dotnet/sdk:7.0
commands:
- cd Project/EntityFramework/
- dotnet restore webAPI.sln
- dotnet test webAPI.sln --no-restore
- cd Project/adminBlazor
- dotnet restore adminBlazor.sln
- dotnet test adminBlazor.sln --no-restore
depends_on: [build]
- name: code-analysis
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7
environment:
project_key: SAE_2A_Anglais_Blazor
sonar_host: https://codefirst.iut.uca.fr/sonar/
sonar_token:
from_secret: SECRET_SONAR_LOGIN
commands:
- cd Project/EntityFramework/
- dotnet restore webAPI.sln
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.login=$${sonar_token} /d:sonar.coverage.exclusions="TU/**, TU_EF/**, TestConsole/**, TestConsole_API/**" /d:sonar.cpd.exclusions="Tests/**, StubbedContextLib/**, StubAPI/**" /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml"
- dotnet build webAPI.sln -c Release --no-restore
- dotnet test webAPI.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 webAPI.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- cd Project/adminBlazor
- dotnet restore adminBlazor.sln
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.login=$${sonar_token}
- dotnet build adminBlazor.sln -c Release --no-restore
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
depends_on: [tests]
- name: swagger
image: mcr.microsoft.com/dotnet/sdk:8.0
failure: ignore
volumes:
- name: docs
path: /docs
environment:
CODEFIRST_CLIENTDRONE_ENV_DOTNET_ROLL_FORWARD: LatestMajor
CODEFIRST_CLIENTDRONE_ENV_DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
commands:
- cd Project/EntityFramework
- dotnet restore webAPI.sln
- cd API
- dotnet new tool-manifest
- dotnet tool install -g --version 14.0.7 NSwag.AspNetCore
- cd ../
- dotnet build webAPI.sln -c Release --no-restore
- dotnet publish webAPI.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet nswag aspnetcore2swagger /assembly:API/bin/Release/net8.0/API.dll /output:/docs/swagger.json
depends_on: [build,tests]
- name: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
failure: ignore
@ -75,69 +47,68 @@ steps:
- /entrypoint.sh
when:
branch:
- WebAPI
- blazor
- blazor-ci
depends_on: [ build ]
volumes:
- name: docs
temp: {}
---
kind: pipeline
type: docker
name: API-CD
trigger:
event:
- push
steps:
- name: docker-build-and-push
- name: docker-build-api
image: plugins/docker
settings:
dockerfile: Project/EntityFramework/API/Dockerfile
context: Project/EntityFramework/
dockerfile: Project/adminBlazor/adminBlazor.Api/Dockerfile
context: Project/adminBlazor/
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/antoine.jourdain/sae_2a_anglais
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
- name: deploy-container-mysql
when:
branch:
- blazor
- blazor-ci
- name: deploy-container-api
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: mariadb:10
CONTAINERNAME: mysql
IMAGENAME: hub.codefirst.iut.uca.fr/antoine.jourdain/sae_2a_anglais:latest
CONTAINERNAME: api-in-english-please
COMMAND: create
OVERWRITE: true
PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_MARIADB_ROOT_PASSWORD:
from_secret: db_root_password
CODEFIRST_CLIENTDRONE_ENV_MARIADB_DATABASE:
from_secret: db_database
CODEFIRST_CLIENTDRONE_ENV_MARIADB_USER:
from_secret: db_user
CODEFIRST_CLIENTDRONE_ENV_MARIADB_PASSWORD:
from_secret: db_password
ADMINS: antoinejourdain,patrickbrugiere,luciegoigoux,marcchevaldonne
depends_on: [ docker-build-api ]
when:
branch:
- blazor
- blazor-ci
- name: docker-build-app
image: plugins/docker
settings:
dockerfile: Project/adminBlazor/adminBlazor/Dockerfile
context: Project/adminBlazor/
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/antoine.jourdain/sae_2a_anglais
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
when:
branch:
- blazor
- blazor-ci
- name: deploy-container
- name: deploy-container-app
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/antoine.jourdain/sae_2a_anglais:latest
CONTAINERNAME: api_container
CONTAINERNAME: in-english-please
COMMAND: create
OVERWRITE: true
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER:
from_secret: db_server
CODEFIRST_CLIENTDRONE_ENV_DB_USER:
from_secret: db_user
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD:
from_secret: db_password
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE:
from_secret: db_database
ADMINS: antoinejourdain,patrickbrugiere,luciegoigoux,marcchevaldonne
depends_on: [ deploy-container-mysql, docker-build-and-push ]
depends_on: [ docker-build-app ]
when:
branch:
- blazor
- blazor-ci
volumes:
- name: docs
temp: {}

Binary file not shown.

Binary file not shown.

@ -1,4 +1,7 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

@ -24,15 +24,15 @@ builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddMvc();
builder.Services.AddDbContext<StubbedContext>(options =>
{
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"));
options.UseSqlServer(builder.Configuration.GetConnectionString("StubbedContext"));
});
builder.Services.AddSwaggerGen(option =>
{
option.SwaggerDoc("v1", new OpenApiInfo { Title = "API", Version = "v1" });
option.SwaggerDoc("v1", new OpenApiInfo { Title = "Test API", Version = "v1" });
option.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
{
In = ParameterLocation.Header,
@ -42,8 +42,6 @@ builder.Services.AddSwaggerGen(option =>
BearerFormat = "JWT",
Scheme = "Bearer"
});
option.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
@ -94,34 +92,26 @@ builder.Services.AddApiVersioning(o =>
o.ReportApiVersions = true;
});
builder.Services.AddScoped<IGroupService, GroupService>();
builder.Services.AddScoped<IService<LangueDTO>, LangueService>();
builder.Services.AddScoped<IService<RoleDTO>, RoleService>();
builder.Services.AddScoped<ITranslateService, TranslateService>();
builder.Services.AddScoped<IService<LangueDTO>,LangueService>();
builder.Services.AddScoped<IService<RoleDTO>,RoleService>();
builder.Services.AddScoped<ITranslateService,TranslateService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddScoped<IVocabularyService, VocabularyService>();
builder.Services.AddScoped<IVocabularyListService, VocabularyListService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("v1/swagger.json", "API V1");
});
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
var scope = app.Services.CreateScope();
var services = scope.ServiceProvider;
var context = services.GetRequiredService<StubbedContext>();
context.Database.EnsureCreated();
app.Run();

@ -0,0 +1,13 @@
namespace API
{
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

@ -11,8 +11,5 @@
"SymmetricSecurityKey": "fvh8456477hth44j6wfds98bq9hp8bqh9ubq9gjig3qr0[94vj5",
"JwtRegisteredClaimNamesSub": "345h098bb8reberbwr4vvb8945"
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Data Source=Db.in_english_please.db"
}
"AllowedHosts": "*"
}

@ -15,6 +15,7 @@ namespace DbContextLib
public DbSet<VocabularyEntity> Vocabularys { get; set; }
public DbSet<VocabularyListEntity> VocabularyLists { get; set; }
//permet de créer une base de donnée (fichier .db) ici en Sqlite avec le nom Db.Books.db
public SAEContext(DbContextOptions<SAEContext> options): base(options)

@ -10,7 +10,7 @@ using StubbedContextLib;
namespace StubbedContextLib.Migrations
{
[DbContext(typeof(StubbedContext))]
[Migration("20240331221744_newMigs")]
[Migration("20240331212614_newMigs")]
partial class newMigs
{
/// <inheritdoc />

@ -21,6 +21,7 @@
<ItemGroup>
<ProjectReference Include="..\API\API.csproj" />
<ProjectReference Include="..\DbContext\DbContextLib.csproj" />
<ProjectReference Include="..\StubbedContext\StubbedContextLib.csproj" />
</ItemGroup>
<ItemGroup>

@ -1,11 +1,11 @@
# SAE 2A Anglais
# SAE 2A Anglais
Ce projet vise à faciliter l'apprentissage de l'anglais dans le cadre d'études supérieures grâce à un site internet et une application mobile.
## Exécuter localement
Clonez le projet
Clonez le projet
```bash
git clone https://codefirst.iut.uca.fr/git/antoine.jourdain/SAE_2A_Anglais.git
@ -19,6 +19,10 @@ Allez dans le répertoire
Suivez les différentes instructions suivant la partie que vous souhaitez lancer.
### Android
Pour la partie android, merci de vous mettre sur la branche dites android et de lancer l'application grâce à Android Studio.
### EF et WebAPI
Bonjour cette partie a été réalisé par Patrick Brugière seul.

Loading…
Cancel
Save