diff --git a/.drone.yml b/.drone.yml index 6b39127..ed13d1e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,23 +1,82 @@ -image: mcr.microsoft.com/dotnet/sdk:8.0 +kind: pipeline +type: docker +name: CI_ApiPm -volumes: - - name: docs - path: /docs +trigger: + event: + - push + branch: + exclude: + - master -- dotnet new tool-manifest -- dotnet tool install NSwag.ConsoleCore -- dotnet nswag aspnetcore2openapi /output:/docs/swagger.json +steps: + - name: retore & build + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - dotnet build --configuration Release + depend_on: [clone] -volumes: -- name: docs - temp: {} + - 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 -image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer volumes: - - name: docs - path: /docs + - name: doc + temp: {} + + +steps: + - name: retore & build + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - dotnet build --configuration Release + depend_on: [clone] -commands: - - /entrypoint.sh + - name: test + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - dotnet test + depends_on: [retore & build] -depends_on: [ previous_job_name ] \ No newline at end of file + - 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] \ No newline at end of file