From ad336d48f3842be787f50793748bb8e1416e0daf Mon Sep 17 00:00:00 2001 From: clchieu Date: Tue, 20 Feb 2024 23:34:29 +0100 Subject: [PATCH 1/7] =?UTF-8?q?:construction=5Fworker:=20:construction:=20?= =?UTF-8?q?D=C3=A9but=20de=20la=20ci/cd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drone.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 drone.yml diff --git a/drone.yml b/drone.yml new file mode 100644 index 0000000..e104556 --- /dev/null +++ b/drone.yml @@ -0,0 +1,23 @@ +kind: pipeline +type: docker +name: SQLuedoCICD + +trigger: + event: + - push + +steps: + - name: build + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - cd API_SQLuedo/ + - dotnet restore API_SQLuedo.sln + - dotnet build API_SQLuedo.sln -c Release --no-restore + + - name: tests + image: mcr.microsoft.com/dotnet/sdk:8.0 + commands: + - cd API_SQLuedo/ + - dotnet test API_SQLuedo.sln -c Release --no-build --no-restore + depends_on: + - [build] \ No newline at end of file From 6f9ee116fbc9d9cbc94fe6e6c58080e77a2550c0 Mon Sep 17 00:00:00 2001 From: clchieu Date: Wed, 21 Feb 2024 22:16:19 +0100 Subject: [PATCH 2/7] :construction: Ajout de la code inspection --- drone.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drone.yml b/drone.yml index e104556..d3a1a7f 100644 --- a/drone.yml +++ b/drone.yml @@ -13,11 +13,32 @@ steps: - cd API_SQLuedo/ - dotnet restore API_SQLuedo.sln - dotnet build API_SQLuedo.sln -c Release --no-restore - + - name: tests image: mcr.microsoft.com/dotnet/sdk:8.0 commands: - cd API_SQLuedo/ - dotnet test API_SQLuedo.sln -c Release --no-build --no-restore depends_on: - - [build] \ No newline at end of file + - [ build ] + + - 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: + from_secret: LOGIN_SECURE_TOKEN + project_key: API_SQLuedo + coverage_exclusions: "Test*/**" + commands: + - cd Sources/ + - dotnet restore API_SQLuedo.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 build API_SQLuedo.sln -c Release --no-restore + - dotnet test API_SQLuedo.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" + - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" + - dotnet publish API_SQLuedo.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release + - dotnet sonarscanner end /d:sonar.login=$${sonar_token} + depends_on: + - [ build ] \ No newline at end of file From cd17c5978907cbea48dc45219b60d419db010db7 Mon Sep 17 00:00:00 2001 From: clchieu Date: Wed, 21 Feb 2024 22:20:50 +0100 Subject: [PATCH 3/7] :construction: Modification du nom de la ci, ajout de restore dans le test et ajout vers le bon dossier --- drone.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drone.yml b/drone.yml index d3a1a7f..3d73d76 100644 --- a/drone.yml +++ b/drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: docker -name: SQLuedoCICD +name: API_SQLuedo trigger: event: @@ -18,6 +18,7 @@ steps: image: mcr.microsoft.com/dotnet/sdk:8.0 commands: - cd API_SQLuedo/ + - dotnet restore API_SQLuedo.sln - dotnet test API_SQLuedo.sln -c Release --no-build --no-restore depends_on: - [ build ] @@ -32,7 +33,7 @@ steps: project_key: API_SQLuedo coverage_exclusions: "Test*/**" commands: - - cd Sources/ + - cd API_SQLuedo/ - dotnet restore API_SQLuedo.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 build API_SQLuedo.sln -c Release --no-restore From 1f8592ef557ac58be58e7c0a66ff4e925868bc95 Mon Sep 17 00:00:00 2001 From: clchieu Date: Wed, 21 Feb 2024 22:27:14 +0100 Subject: [PATCH 4/7] :construction: test de la ci/cd --- drone.yml => .drone.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename drone.yml => .drone.yml (100%) diff --git a/drone.yml b/.drone.yml similarity index 100% rename from drone.yml rename to .drone.yml From a0e80957ccd6c6e6aa23391e1483e626a45e602c Mon Sep 17 00:00:00 2001 From: clchieu Date: Wed, 21 Feb 2024 22:28:20 +0100 Subject: [PATCH 5/7] =?UTF-8?q?:construction:=20modification=20des=20d?= =?UTF-8?q?=C3=A9pendaces=20de=20test=20et=20de=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3d73d76..ce63564 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,7 +21,7 @@ steps: - dotnet restore API_SQLuedo.sln - dotnet test API_SQLuedo.sln -c Release --no-build --no-restore depends_on: - - [ build ] + - [build] - name: code-inspection image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8 @@ -42,4 +42,4 @@ steps: - dotnet publish API_SQLuedo.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release - dotnet sonarscanner end /d:sonar.login=$${sonar_token} depends_on: - - [ build ] \ No newline at end of file + - [build] \ No newline at end of file From abef5133df8bb921daf9543833b009ac82dbf51f Mon Sep 17 00:00:00 2001 From: clchieu Date: Wed, 21 Feb 2024 22:30:29 +0100 Subject: [PATCH 6/7] =?UTF-8?q?:construction:=20Suppression=20de=20retour?= =?UTF-8?q?=20=C3=A0=20la=20ligne=20et=20de=20tirets=20probl=C3=A9matiques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index ce63564..d400fdd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,8 +20,7 @@ steps: - cd API_SQLuedo/ - dotnet restore API_SQLuedo.sln - dotnet test API_SQLuedo.sln -c Release --no-build --no-restore - depends_on: - - [build] + depends_on: [ build ] - name: code-inspection image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet8 @@ -41,5 +40,4 @@ steps: - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" - dotnet publish API_SQLuedo.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release - dotnet sonarscanner end /d:sonar.login=$${sonar_token} - depends_on: - - [build] \ No newline at end of file + depends_on: [ build ] \ No newline at end of file From 30b154d58657cafd9e260fb875ff20fa38cfea31 Mon Sep 17 00:00:00 2001 From: clchieu Date: Wed, 21 Feb 2024 22:36:47 +0100 Subject: [PATCH 7/7] :construction: Tentative de modification du sonar token --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index d400fdd..483215f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,7 +28,7 @@ steps: environment: sonar_host: https://codefirst.iut.uca.fr/sonar/ sonar_token: - from_secret: LOGIN_SECURE_TOKEN + from_secret: SECRET_SONAR_LOGIN project_key: API_SQLuedo coverage_exclusions: "Test*/**" commands: