deploiement 3
continuous-integration/drone/push Build is failing Details

pull/29/head
Maxime ROCHER 3 months ago
parent 3b96126e7d
commit 0875452004

@ -1,6 +1,6 @@
kind: pipeline kind: pipeline
type: docker
name: CI name: CI
type: docker
trigger: trigger:
event: event:
@ -8,7 +8,7 @@ trigger:
steps: steps:
- name: build - name: build
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6 image: mcr.microsoft.com/dotnet/sdk:6.0
commands: commands:
- cd WF-WebAdmin/WF-WebAdmin - cd WF-WebAdmin/WF-WebAdmin
- dotnet restore WF-WebAdmin.csproj - dotnet restore WF-WebAdmin.csproj
@ -16,7 +16,7 @@ steps:
- dotnet publish WF-WebAdmin.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/publish - dotnet publish WF-WebAdmin.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/publish
- name: tests - name: tests
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6 image: mcr.microsoft.com/dotnet/sdk:6.0
commands: commands:
- cd WF-WebAdmin/WF-WebAdmin - cd WF-WebAdmin/WF-WebAdmin
- dotnet restore WF-WebAdmin.csproj - dotnet restore WF-WebAdmin.csproj
@ -41,7 +41,7 @@ steps:
from_secret: sonar_token from_secret: sonar_token
project_key: web_admin project_key: web_admin
coverage_exclusions: "Tests/**" coverage_exclusions: "Tests/**"
depends_on: [tests] depends_on: [ tests ]
- name: generate-and-deploy-docs - name: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
@ -71,14 +71,20 @@ steps:
depends_on: [ build, tests, code-analysis ] depends_on: [ build, tests, code-analysis ]
- name: deploy - name: deploy
image: hub.codefirst.iut.uca.fr/celeste.barbosa/codefirst-dockerproxy-clientdrone image: mcr.microsoft.com/dotnet/aspnet:6.0
environment: environment:
IMAGENAME: hub.codefirst.iut.uca.fr/whatthefantasy/wf-webadmin IMAGENAME: hub.codefirst.iut.uca.fr/whatthefantasy/wf-webadmin
CONTAINERNAME: WF-WebAdmin CONTAINERNAME: WF-WebAdmin
COMMAND: create COMMAND: create
OVERWRITE: true OVERWRITE: true
ADMINS: maximerocher,kevinmondejar,lenibeaulaton,kentinbrongniart,tommynguyen ADMINS: maximerocher,kevinmondejar,lenibeaulaton,kentinbrongniart,tommynguyen
commands:
- dotnet /app/WF-WebAdmin.dll
when: when:
branch: branch:
- master - master
depends_on: [ docker_build ] depends_on: [ docker_build ]
volumes:
- name: docs
temp: {}

@ -1,17 +1,22 @@
# Étape de base avec l'image runtime ASP.NET # Étape 1 : Build de l'application
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
EXPOSE 80
# Étape de build pour publier l'application
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src WORKDIR /src
# Copier les fichiers de solution et restaurer les dépendances
COPY WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj ./WF-WebAdmin/WF-WebAdmin/
RUN dotnet restore ./WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj
# Copier tout le reste et publier
COPY . . COPY . .
RUN dotnet restore "WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj" RUN dotnet publish ./WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj -c Release -o /app/publish
RUN dotnet publish "WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj" -c Release -o /app/publish
# Étape finale : copie des fichiers publiés et définition du point d'entrée # Étape 2 : Image runtime
FROM base AS final FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
WORKDIR /app WORKDIR /app
COPY --from=build /app/publish . COPY --from=build /app/publish .
# Exposer le port utilisé par l'application
EXPOSE 5000
# Lancer l'application
ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"] ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"]

Loading…
Cancel
Save