|
|
@ -1,37 +1,34 @@
|
|
|
|
kind: pipeline
|
|
|
|
kind: pipeline
|
|
|
|
name: CI
|
|
|
|
|
|
|
|
type: docker
|
|
|
|
type: docker
|
|
|
|
|
|
|
|
name: CI
|
|
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- push
|
|
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
|
# 1. BUILD
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
- name: build
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0
|
|
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
|
|
|
commands:
|
|
|
|
commands:
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
- dotnet build WF-WebAdmin.csproj -c Release --no-restore
|
|
|
|
- dotnet build WF-WebAdmin.csproj -c Release --no-restore
|
|
|
|
- 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
|
|
|
|
|
|
|
|
|
|
|
|
# 2. TESTS
|
|
|
|
|
|
|
|
- name: tests
|
|
|
|
- name: tests
|
|
|
|
image: mcr.microsoft.com/dotnet/sdk:6.0
|
|
|
|
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dronesonarplugin-dotnet6
|
|
|
|
commands:
|
|
|
|
commands:
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
- cd WF-WebAdmin/WF-WebAdmin
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
- dotnet restore WF-WebAdmin.csproj
|
|
|
|
- dotnet test WF-WebAdmin.csproj --no-restore
|
|
|
|
- dotnet test WF-WebAdmin.csproj --no-restore
|
|
|
|
depends_on: [ build ]
|
|
|
|
depends_on: [ build ]
|
|
|
|
|
|
|
|
|
|
|
|
# 3. CODE ANALYSIS (SONARQUBE) - Exemple, si tu utilises Sonar
|
|
|
|
|
|
|
|
- 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
|
|
|
|
commands:
|
|
|
|
commands:
|
|
|
|
- cd WF-WebAdmin/
|
|
|
|
- cd WF-WebAdmin/
|
|
|
|
- dotnet restore WF-WebAdmin.sln
|
|
|
|
- dotnet restore WF-WebAdmin.sln
|
|
|
|
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
|
|
|
|
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
|
|
|
|
- dotnet build WF-WebAdmin.sln -c Release --no-restore
|
|
|
|
- dotnet build WF-WebAdmin.sln -c Release --no-restore
|
|
|
|
- dotnet test WF-WebAdmin.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
|
|
|
|
- dotnet test WF-WebAdmin.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"
|
|
|
@ -44,9 +41,8 @@ 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]
|
|
|
|
|
|
|
|
|
|
|
|
# 4. GÉNÉRATION ET DÉPLOIEMENT DE DOCS (optionnel)
|
|
|
|
|
|
|
|
- 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
|
|
|
|
failure: ignore
|
|
|
|
failure: ignore
|
|
|
@ -60,7 +56,6 @@ steps:
|
|
|
|
- master
|
|
|
|
- master
|
|
|
|
depends_on: [ build ]
|
|
|
|
depends_on: [ build ]
|
|
|
|
|
|
|
|
|
|
|
|
# 5. BUILD DE L'IMAGE DOCKER ET PUSH
|
|
|
|
|
|
|
|
- name: docker_build
|
|
|
|
- name: docker_build
|
|
|
|
image: plugins/docker
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
settings:
|
|
|
@ -75,17 +70,15 @@ steps:
|
|
|
|
from_secret: docker_password
|
|
|
|
from_secret: docker_password
|
|
|
|
depends_on: [ build, tests, code-analysis ]
|
|
|
|
depends_on: [ build, tests, code-analysis ]
|
|
|
|
|
|
|
|
|
|
|
|
# 6. DEPLOY
|
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
- name: deploy
|
|
|
|
image: hub.codefirst.iut.uca.fr/whatthefantasy/wf-webadmin:latest
|
|
|
|
image:
|
|
|
|
commands:
|
|
|
|
environment:
|
|
|
|
- ls /app
|
|
|
|
IMAGENAME: hub.codefirst.iut.uca.fr/whatthefantasy/wf-webadmin
|
|
|
|
- dotnet /app/WF-WebAdmin.dll
|
|
|
|
CONTAINERNAME: WF-WebAdmin
|
|
|
|
|
|
|
|
COMMAND: create
|
|
|
|
|
|
|
|
OVERWRITE: true
|
|
|
|
|
|
|
|
ADMINS: maximerocher,kevinmondejar,lenibeaulaton,kentinbrongniart,tommynguyen
|
|
|
|
when:
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
- master
|
|
|
|
depends_on: [ docker_build ]
|
|
|
|
depends_on: [ docker_build ]
|
|
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
|
|
- name: docs
|
|
|
|
|
|
|
|
temp: {}
|
|
|
|
|
|
|
|