Mise à jour de '.drone.yml'

WORK-WEB-API
Kevin MONTEIRO 1 year ago
parent 7b02c1c5f5
commit ec0640abc7

@ -1,70 +1,70 @@
kind: pipeline kind: pipeline
type: docker type: docker
name: HeartTrack-API name: HeartTrack-API
trigger: trigger:
branch: branch:
- WORK-CD - WORK-CD
event: event:
- push - push
steps: steps:
- name: build - name: build
image: mcr.microsoft.com/dotnet/sdk:8.0 image: mcr.microsoft.com/dotnet/sdk:8.0
commands: commands:
- cd src/ - cd src/
- dotnet restore HeartTrack.sln - dotnet restore HeartTrack.sln
- dotnet build HeartTrack.sln -c Release --no-restore - dotnet build HeartTrack.sln -c Release --no-restore
- dotnet publish HeartTrack.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release - dotnet publish HeartTrack.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
- name: docker-build-and-push - name: docker-build-and-push
image: plugins/docker image: plugins/docker
settings: settings:
dockerfile: src/HeartTrackAPI/Dockerfile dockerfile: src/HeartTrackAPI/Dockerfile
context: src/ context: src/
registry: hub.codefirst.iut.uca.fr registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/heartdev/api repo: hub.codefirst.iut.uca.fr/heartdev/api
username: username:
from_secret: SECRET_REGISTRY_USERNAME from_secret: SECRET_REGISTRY_USERNAME
password: password:
from_secret: SECRET_REGISTRY_PASSWORD from_secret: SECRET_REGISTRY_PASSWORD
- name: deploy-container - name: deploy-container
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment: environment:
IMAGENAME:hub.codefirst.iut.uca.fr/heartdev/api:latest IMAGENAME: hub.codefirst.iut.uca.fr/heartdev/api:latest
CONTAINERNAME: api CONTAINERNAME: api
COMMAND: create COMMAND: create
OVERWRITE: true OVERWRITE: true
depends_on: [ docker-build-and-push ] depends_on: [ docker-build-and-push ]
- name: code-analysis - name: code-analysis
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8 image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8
secrets: [ SECRET_SONAR_LOGIN ] secrets: [ SECRET_SONAR_LOGIN ]
settings: settings:
sonar_host: https://codefirst.iut.uca.fr/sonar/ sonar_host: https://codefirst.iut.uca.fr/sonar/
sonar_token: sonar_token:
from_secret: SECRET_SONAR_LOGIN from_secret: SECRET_SONAR_LOGIN
project_key: HeartTrack-API project_key: HeartTrack-API
coverage_exclusions: "Tests/**" coverage_exclusions: "Tests/**"
commands: commands:
- cd src/ - cd src/
- dotnet restore HeartTrack.sln - dotnet restore HeartTrack.sln
- dotnet sonarscanner begin /k:HeartTrack-API /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN} /d:sonar.coverage.exclusions="Tests/**" - dotnet sonarscanner begin /k:HeartTrack-API /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN} /d:sonar.coverage.exclusions="Tests/**"
- dotnet build HeartTrack.sln -c Release --no-restore - dotnet build HeartTrack.sln -c Release --no-restore
- dotnet test HeartTrack.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - dotnet test HeartTrack.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
- reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
- dotnet publish HeartTrack.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release - dotnet publish HeartTrack.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- name: generate-and-deploy-docs - name: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/maxime.batista/codefirst-docdeployer image: hub.codefirst.iut.uca.fr/maxime.batista/codefirst-docdeployer
failure: ignore failure: ignore
commands: commands:
- /entrypoint.sh -l docs/doxygen -t doxygen - /entrypoint.sh -l docs/doxygen -t doxygen
when: when:
event: event:
- push - push
depends_on: [ build ] depends_on: [ build ]
Loading…
Cancel
Save