From 2e2d1efde33c9cadb3271c5bfc35f8dde6b0470f Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:44:38 +0200 Subject: [PATCH 01/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5058427 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +# This file is a template, and might need editing before it works on your project. +# This is a sample GitLab CI/CD configuration file that should run without any modifications. +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, +# it uses echo commands to simulate the pipeline execution. +# +# A pipeline is composed of independent jobs that run scripts, grouped into stages. +# Stages run in sequential order, but jobs within stages run in parallel. +# +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/#stages +# +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/development/cicd/templates/ +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + +image: powershell/test-deps + +stages: # List of stages for jobs, and their order of execution + - build + - deploy + +build-job: # This job runs in the build stage, which runs first. + stage: build + script: + - Install-Module ps2exe -Confirm:$False -Force + - ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole + +deploy-job: # This job runs in the deploy stage. + stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + environment: production + script: + - echo "Deploying application..." + - echo "Application successfully deployed." From 9d5a44ae92e767dc3844d8c6485441a9434f6e8b Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:47:02 +0200 Subject: [PATCH 02/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5058427..6785c85 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ # This specific template is located at: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml -image: powershell/test-deps +image: microsoft/powershell-test-deps stages: # List of stages for jobs, and their order of execution - build From 221ad72a5915fb14ec2248b0149303d16215a710 Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:49:12 +0200 Subject: [PATCH 03/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6785c85..3eb3a5c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ # This specific template is located at: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml -image: microsoft/powershell-test-deps +image: mcr.microsoft.com/powershell/test-deps stages: # List of stages for jobs, and their order of execution - build From dad7aefb955b4e3702a15bc685f1c0748947d625 Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:50:00 +0200 Subject: [PATCH 04/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3eb3a5c..cbc19e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ # This specific template is located at: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml -image: mcr.microsoft.com/powershell/test-deps +image: mcr.microsoft.com/powershell/test-deps:ubuntu-18.04 stages: # List of stages for jobs, and their order of execution - build From c407b75a043bf58b05a5e9f5b9aad28d7b161a99 Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:50:49 +0200 Subject: [PATCH 05/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbc19e9..25fe925 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,8 +25,8 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build script: - - Install-Module ps2exe -Confirm:$False -Force - - ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole + - powershell Install-Module ps2exe -Confirm:$False -Force + - powershell ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From 09719607786f4e870c2e25f369c3ea40684b19b0 Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:57:21 +0200 Subject: [PATCH 06/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25fe925..6e66823 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ # This specific template is located at: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml -image: mcr.microsoft.com/powershell/test-deps:ubuntu-18.04 +image: ubuntu stages: # List of stages for jobs, and their order of execution - build @@ -25,6 +25,12 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build script: + - apt-get update + - apt-get install -y wget apt-transport-https software-properties-common + - source /etc/os-release + - wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb + - dpkg -i packages-microsoft-prod.deb + - apt-get update && apt-get install -y powershell - powershell Install-Module ps2exe -Confirm:$False -Force - powershell ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole From 0859929cbdd25c39e1ba00e36f83a34d18fa583c Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 09:58:35 +0200 Subject: [PATCH 07/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e66823..502198e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,8 +31,8 @@ build-job: # This job runs in the build stage, which runs first. - wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb - dpkg -i packages-microsoft-prod.deb - apt-get update && apt-get install -y powershell - - powershell Install-Module ps2exe -Confirm:$False -Force - - powershell ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole + - pwsh Install-Module ps2exe -Confirm:$False -Force + - pwsh ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From 9dc69e3f2fc5f115e51c74813826ef5ef91c8984 Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 10:01:18 +0200 Subject: [PATCH 08/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 502198e..35fe541 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,8 +31,8 @@ build-job: # This job runs in the build stage, which runs first. - wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb - dpkg -i packages-microsoft-prod.deb - apt-get update && apt-get install -y powershell - - pwsh Install-Module ps2exe -Confirm:$False -Force - - pwsh ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole + - pwsh -Command {Install-Module ps2exe -Confirm:$False -Force} + - pwsh -Command {ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole} deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. From c79b2337194f07e7a6b75fad896f77453f78eb0b Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 10:07:17 +0200 Subject: [PATCH 09/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35fe541..dd5c89a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,7 +33,12 @@ build-job: # This job runs in the build stage, which runs first. - apt-get update && apt-get install -y powershell - pwsh -Command {Install-Module ps2exe -Confirm:$False -Force} - pwsh -Command {ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole} - + artifacts: + when: on_success + access: all + paths: + - ./laps.exe + expire_in: 30 days deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. environment: production From 91a3e0372e5ae41eb7112c562ecfb6c3cf7b2766 Mon Sep 17 00:00:00 2001 From: "J. Secula" Date: Thu, 5 Jun 2025 10:11:40 +0200 Subject: [PATCH 10/10] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd5c89a..4af7366 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,6 +33,7 @@ build-job: # This job runs in the build stage, which runs first. - apt-get update && apt-get install -y powershell - pwsh -Command {Install-Module ps2exe -Confirm:$False -Force} - pwsh -Command {ps2exe .\laps.ps1 -requireAdmin -noOutput -noError -title "LAPS" -description "Outil pour récupérer un mot de passe LAPS dans un Active Directory" -Company "Académie Nancy-Metz" -noconsole} + - ls . artifacts: when: on_success access: all