Compare commits
No commits in common. 'master' and 'API_init' have entirely different histories.
@ -1,208 +1,82 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI_ApiPm
|
||||
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
- tag
|
||||
branch:
|
||||
exclude:
|
||||
- master
|
||||
|
||||
volumes:
|
||||
- name: docs
|
||||
temp: {}
|
||||
|
||||
steps:
|
||||
- name: restore & build
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet build WF_EF_Api/WF_EF_Api.sln --configuration Release
|
||||
depends_on: [clone]
|
||||
|
||||
- name: test
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet test WF_EF_Api/XUnitTest/XUnitTest.csproj
|
||||
depends_on: [restore & build]
|
||||
|
||||
- name: publish
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet publish WF_EF_Api/WfApi/WfApi.csproj -c Release -o out
|
||||
depends_on: [restore & build, test]
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI_ApiPm_Master
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- master
|
||||
|
||||
volumes:
|
||||
- name: doc
|
||||
temp: {}
|
||||
|
||||
steps:
|
||||
- name: restore & build
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet build WF_EF_Api/WF_EF_Api.sln --configuration Release
|
||||
depends_on: [clone]
|
||||
|
||||
- name: test
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet test WF_EF_Api/XUnitTest/XUnitTest.csproj
|
||||
depends_on: [restore & build]
|
||||
|
||||
- name: generate doc
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
volumes:
|
||||
- name: doc
|
||||
path: /doc
|
||||
commands:
|
||||
- dotnet new tool-manifest
|
||||
- dotnet tool install NSwag.ConsoleCore
|
||||
- dotnet restore WF_EF_Api/WF_EF_Api.sln
|
||||
- dotnet clean WF_EF_Api/WfApi/WfApi.csproj
|
||||
- cd WF_EF_Api/WfApi
|
||||
- dotnet nswag aspnetcore2openapi /output:/doc/swagger.json
|
||||
depends_on: [clone, restore & build , test]
|
||||
|
||||
- name: code-inspection
|
||||
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
|
||||
secrets: [ SECRET_SONAR_LOGIN ]
|
||||
environment:
|
||||
sonar_host: https://codefirst.iut.uca.fr/sonar/
|
||||
sonar_token_wtf:
|
||||
from_secret: SECRET_SONAR_LOGIN
|
||||
project_key: wtf-service
|
||||
commands:
|
||||
- dotnet restore WF_EF_Api/WF_EF_Api.sln
|
||||
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.login=$${sonar_token_wtf}
|
||||
- dotnet build WF_EF_Api/WF_EF_Api.sln -c Release --no-restore
|
||||
- dotnet test WF_EF_Api/XUnitTest/XUnitTest.csproj --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
||||
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
|
||||
- dotnet sonarscanner end /d:sonar.login=$${sonar_token_wtf}
|
||||
depends_on: [test,generate doc]
|
||||
|
||||
- name: publish
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet publish WF_EF_Api/WfApi/WfApi.csproj -c Release -o out
|
||||
depends_on: [restore & build, test]
|
||||
|
||||
- name: deploy-api-db
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: postgres:16.8-alpine3.20
|
||||
CONTAINERNAME: wtf-api
|
||||
COMMAND: create
|
||||
PRIVATE: true
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
|
||||
from_secret: POSTGRES_PASSWORD_API
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
|
||||
from_secret: POSTGRES_USER_API
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
|
||||
from_secret: POSTGRES_DB_API
|
||||
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2
|
||||
|
||||
- name: deploy-auth-db
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: postgres:16.8-alpine3.20
|
||||
CONTAINERNAME: wtf-api-auth
|
||||
COMMAND: create
|
||||
PRIVATE: true
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
|
||||
from_secret: POSTGRES_PASSWORD_AUTH
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
|
||||
from_secret: POSTGRES_USER_AUTH
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
|
||||
from_secret: POSTGRES_DB_AUTH
|
||||
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2
|
||||
|
||||
- name: deploy-test-db
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: postgres:16.8-alpine3.20
|
||||
CONTAINERNAME: wtf-api-test
|
||||
COMMAND: create
|
||||
PRIVATE: true
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD: "test"
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER: "test"
|
||||
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB: "wtf-test"
|
||||
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2
|
||||
|
||||
|
||||
- name: update-database
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
#DB_PATH_AUTH: "WhatTheFantasy-wtf-api-auth"
|
||||
environment:
|
||||
HOST: "WhatTheFantasy-wtf-api-test"
|
||||
PASSWORD: "test"
|
||||
USER: "test"
|
||||
DB: "wtf-test"
|
||||
commands:
|
||||
- cd WF_EF_Api/StubbedContextLib
|
||||
- dotnet tool install --global dotnet-ef
|
||||
- export PATH="$PATH:/root/.dotnet/tools"
|
||||
- dotnet ef database update --connection "Host=$${HOST};Database=$${DB};Username=$${USER};Password=$${PASSWORD};"
|
||||
depends_on: [deploy-api-db,deploy-auth-db,deploy-test-db]
|
||||
|
||||
- name: publish-to-registry
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: WF_EF_Api/WfApi/Dockerfile
|
||||
context: WF_EF_Api/
|
||||
registry: hub.codefirst.iut.uca.fr
|
||||
repo: hub.codefirst.iut.uca.fr/whatthefantasy/wf-pmapi
|
||||
username:
|
||||
from_secret: SECRET_REGISTRY_USERNAME
|
||||
password:
|
||||
from_secret: SECRET_REGISTRY_PASSWORD
|
||||
depends_on: [restore & build, test, code-inspection, publish]
|
||||
|
||||
- name: deploy-container
|
||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
||||
environment:
|
||||
IMAGENAME: hub.codefirst.iut.uca.fr/whatthefantasy/wf-pmapi:latest
|
||||
CONTAINERNAME: web-services
|
||||
COMMAND: create
|
||||
OVERWRITE: true
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API: "WhatTheFantasy-wtf-api"
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_USER_API:
|
||||
from_secret: POSTGRES_USER_API
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_API:
|
||||
from_secret: POSTGRES_PASSWORD_API
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_API:
|
||||
from_secret: POSTGRES_DB_API
|
||||
|
||||
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_AUTH: "WhatTheFantasy-wtf-api-auth"
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_USER_AUTH:
|
||||
from_secret: POSTGRES_USER_AUTH
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_AUTH:
|
||||
from_secret: POSTGRES_PASSWORD_AUTH
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_AUTH:
|
||||
from_secret: POSTGRES_DB_AUTH
|
||||
|
||||
|
||||
#CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API_TEST: "WhatTheFantasy-wtf-api-test"
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_SERVER_API_TEST: "api-test"
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_USER_API_TEST: "test"
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_PASSWORD_API_TEST: "test"
|
||||
CODEFIRST_CLIENTDRONE_ENV_DB_DATABASE_API_TEST: "wtf-db-test"
|
||||
|
||||
|
||||
ADMINS: kentinbrongniart,lenibeaulaton,kevinmondejar,louisguichard-montguers,maximerocher,tommynguyen2
|
||||
depends_on: [restore & build, test, code-inspection, publish, publish-to-registry]
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI_ApiPm
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
exclude:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: retore & build
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet build --configuration Release
|
||||
depend_on: [clone]
|
||||
|
||||
- name: test
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet test
|
||||
depends_on: [retore & build]
|
||||
|
||||
- name: publish
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet publish -c Release -o out
|
||||
depends_on: [retore & build, test]
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: CI_ApiPm_Master
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- master
|
||||
|
||||
volumes:
|
||||
- name: doc
|
||||
temp: {}
|
||||
|
||||
|
||||
steps:
|
||||
- name: retore & build
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet build --configuration Release
|
||||
depend_on: [clone]
|
||||
|
||||
- name: test
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet test
|
||||
depends_on: [retore & build]
|
||||
|
||||
- name: generate doc
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
volumes:
|
||||
- name: doc
|
||||
path: /doc
|
||||
commands:
|
||||
- dotnet new tool-manifest
|
||||
- dotnet tool install NSwag.ConsoleCore
|
||||
- dotnet restore
|
||||
- cd WF_EF_Api/WfApi
|
||||
- dotnet nswag aspnetcore2openapi /output:/doc/swagger.json
|
||||
depends_on: [clone, retore & build]
|
||||
|
||||
#- name: code-inspection
|
||||
# image: hub.codefirst.iut.uca.fr/marc.chevaldonne:codefirs-dronsonarplugin-dotnet8
|
||||
# secret: [SECRET_SONAR_LOGIN]
|
||||
# A FINIR
|
||||
- name: publish
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
commands:
|
||||
- dotnet publish -c Release -o out
|
||||
depends_on: [retore & build, test]
|
@ -1,75 +1,6 @@
|
||||
# WF-PmAPI
|
||||
|
||||
### Commandes de démarrage
|
||||
Installer les outils dotnet
|
||||
```bash
|
||||
dotnet tool install --global dotnet-ef
|
||||
```
|
||||
|
||||
Générer une migration
|
||||
```bash
|
||||
dotnet ef migrations add myFirstMigration
|
||||
```
|
||||
|
||||
Générer la base de donnée
|
||||
```bash
|
||||
dotnet ef database update
|
||||
```
|
||||
|
||||
|
||||
### Paquets
|
||||
- NSwag.AspNetCore <br>
|
||||
- Moq
|
||||
|
||||
🟨 En cours / ✅ Fait / ❌ Pas fait
|
||||
|
||||
### Critères Entity Framework
|
||||
|
||||
niveau | description | coeff | jalon | État
|
||||
--- | --- | --- | --- | ---
|
||||
☢️ | Le dépôt doit être accessible par l'enseignant | ☢️ | J1 | ✅
|
||||
☢️ | un .gitignore doit exister au premier push | ☢️ | J1 | ✅
|
||||
🎬 | les *projets* et les tests compilent | 1 | J1 & J2 | ✅
|
||||
🎬 | le projet et le tests s'exécutent sans bug (concernant la partie persistance) | 3 | J1 & J2 | ✅
|
||||
🟢 | Transcription du modèle : Modèle vers entités (et inversement) | 2 | J1 | ✅
|
||||
🟢 | Requêtes CRUD simples (sur une table) | 1 | J1 | ✅
|
||||
🟢 | Utilisation de LINQ to Entities | 2 | J1 | ✅
|
||||
🟡 | Injection / indépendance du fournisseur | 1 | J1 | ✅
|
||||
🟡 | Requêtes CRUD sur des données complexes (images par exemple) | 2 | J1 | ✅
|
||||
🟢 | Tests - Appli Console | 1 | J1 | ✅
|
||||
🟢 | Tests - Tests unitaires (avec SQLite in memory) | 2 | J1 | ❌
|
||||
🟢 | Tests - Données stubbées et/ou Moq | 1 | J1 | ✅
|
||||
🟡 | CI : build, tests, Sonar (doc?) | 1 | J1 | ✅
|
||||
🟡 | Utilisation de relations (One-to-One, One-to-Many, Many-to-Many) (+ mapping, TU, Requêtes) | 4 | J1 | ✅
|
||||
🟢 | Liens avec le web service | 2 | J1 | ✅
|
||||
🟡 | Utilisation d'un *Logger* | 1 | J1 | ❌
|
||||
🟡 | Déploiement | 4 | J2 | ✅
|
||||
🔴 | Unit of Work❌ / Repository✅ + extras (héritage, accès concurrents...) | 8 | J2 | 🟨
|
||||
🟢 | Utilisation dans le projet | 2 | J2 | ✅
|
||||
🟢 | mon dépôt possède un readme qui apporte quelque chose... | 2 | J2 | ✅
|
||||
|
||||
|
||||
### Critères Web API
|
||||
|
||||
niveau | description | coeff | jalon | État
|
||||
--- | --- | --- | --- | ---
|
||||
☢️ | Le dépôt doit être accessible par l'enseignant | ☢️ | J1 | ✅
|
||||
☢️ | un .gitignore doit exister au premier push | ☢️ | J1 | ✅
|
||||
🎬 | les *projets* et les tests compilent | 1 | J1 & J2 | ✅
|
||||
🎬 | le projet et le tests s'exécutent sans bug (concernant la partie web api) | 4 | J1 & J2 | ✅
|
||||
🟢 | Modèle <-> DTO | 1 | J1 | ❌
|
||||
🟢 | Entities <-> DTO | 1 | J1 | ✅
|
||||
🟡 | Authentification | 4 | J1 |
|
||||
🟢 | Requêtes GET, PUT, POST, DELETE sur des données simples (1 seul type d'objet en retour, propriétés de types natifs) | 2 | J1 | ✅
|
||||
🟡 | Pagination & filtrage | 2 | J1 | ✅
|
||||
🟢 | Injection de service | 2 | J1 | ✅
|
||||
🟡 | Requêtes GET, PUT, POST, DELETE sur des données complexes (plusieurs données complexes en retour) | 4 | J1 | ✅
|
||||
🟢 | Tests - Appli Console (consommation des requêtes) | 4 | J1 | ✅
|
||||
🟢 | Tests - Tests unitaires (avec Stub et/ou Moq) | 2 | J1 | ✅
|
||||
🟡 | CI : build, tests, Sonar, Documentation (en particulier Swagger avec exemples...) | 1 | J1 | ✅
|
||||
🟢 | Liens avec la persistance en base de données | 4 | J1 | ✅
|
||||
🟡 | Utilisation d'un *Logger* | 1 | J1 | ❌
|
||||
🟡 | Déploiement | 4 | J2 | ✅
|
||||
🟡 | Utilisation dans le projet | 4 | J2 | ✅
|
||||
🎬 | mon dépôt possède un readme qui apporte quelque chose... | 1 | J2 | ✅
|
||||
NSwag.AspNetCore <br>
|
||||
Moq
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,25 @@
|
||||
#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
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["WfApi/WfApi.csproj", "WfApi/"]
|
||||
RUN dotnet restore "./WfApi/WfApi.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/WfApi"
|
||||
RUN dotnet build "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
#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
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["WfApi/WfApi.csproj", "WfApi/"]
|
||||
RUN dotnet restore "./WfApi/WfApi.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/WfApi"
|
||||
RUN dotnet build "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./WfApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "WfApi.dll"]
|
Loading…
Reference in new issue