From 1c9545cc076a5270930f45b9bcbe03af4f1af4eb Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Fri, 8 Nov 2024 10:08:05 +0100 Subject: [PATCH 01/12] fix(gorgone): use Centreon version to create 1 docker images per version with the right repo --- .github/docker/Dockerfile.gorgone-testing-alma8 | 9 +++++++-- .github/docker/Dockerfile.gorgone-testing-alma9 | 9 +++++++-- .github/docker/Dockerfile.gorgone-testing-bookworm | 9 +++++++-- .github/docker/Dockerfile.gorgone-testing-bullseye | 9 +++++++-- .github/docker/Dockerfile.gorgone-testing-jammy | 9 +++++++-- .github/workflows/docker-gorgone-testing.yml | 12 +++++++++++- 6 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-alma8 b/.github/docker/Dockerfile.gorgone-testing-alma8 index 7fe2db43131..bdf2ef9a613 100644 --- a/.github/docker/Dockerfile.gorgone-testing-alma8 +++ b/.github/docker/Dockerfile.gorgone-testing-alma8 @@ -1,11 +1,16 @@ -FROM almalinux:8 +ARG REGISTRY_URL=docker.io +ARG CENTREON_VERSION + +FROM ${REGISTRY_URL}/almalinux:8 + +ENV REPO_VERSION=${CENTREON_VERSION} RUN bash -e < /dev/null 2>&1 diff --git a/.github/docker/Dockerfile.gorgone-testing-bullseye b/.github/docker/Dockerfile.gorgone-testing-bullseye index ef72cb8a57c..1d825fd7ba8 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bullseye +++ b/.github/docker/Dockerfile.gorgone-testing-bullseye @@ -1,4 +1,9 @@ -FROM debian:bullseye +ARG REGISTRY_URL=docker.io +ARG CENTREON_VERSION + +FROM ${REGISTRY_URL}/debian:bullseye + +ENV REPO_VERSION=${CENTREON_VERSION} ENV DEBIAN_FRONTEND noninteractive # fix locale @@ -18,7 +23,7 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 pip3 install robotframework robotframework-examples robotframework-databaselibrary \ pymysql robotframework-requests robotframework-jsonlibrary -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-24.11-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list +lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${REPO_VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ % main' | tee /etc/apt/sources.list.d/centreon-plugins.list wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 diff --git a/.github/docker/Dockerfile.gorgone-testing-jammy b/.github/docker/Dockerfile.gorgone-testing-jammy index 83273c050e7..cb86abd4aed 100644 --- a/.github/docker/Dockerfile.gorgone-testing-jammy +++ b/.github/docker/Dockerfile.gorgone-testing-jammy @@ -1,4 +1,9 @@ -FROM ubuntu:jammy +ARG REGISTRY_URL=docker.io +ARG CENTREON_VERSION + +FROM ${REGISTRY_URL}/ubuntu:jammy + +ENV REPO_VERSION=${CENTREON_VERSION} ENV DEBIAN_FRONTEND=noninteractive @@ -11,7 +16,7 @@ RUN apt-get update && \ ENV LANG=en_US.UTF-8 # Add Centreon repositories and their public key -RUN echo "deb https://packages.centreon.com/ubuntu-standard-24.11-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-testing.list && \ +RUN echo "deb https://packages.centreon.com/ubuntu-standard-${REPO_VERSION}-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-testing.list && \ echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-plugins-testing.list && \ wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 && \ apt-get update diff --git a/.github/workflows/docker-gorgone-testing.yml b/.github/workflows/docker-gorgone-testing.yml index ad7120b68c5..695917a7a45 100644 --- a/.github/workflows/docker-gorgone-testing.yml +++ b/.github/workflows/docker-gorgone-testing.yml @@ -40,12 +40,22 @@ jobs: username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }} password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }} + - name: Login to proxy registry + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 + with: + registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }} + username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }} + password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }} + - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 with: file: .github/docker/Dockerfile.gorgone-testing-${{ matrix.distrib }} context: . + build-args: | + "REGISTRY_URL=${{ vars.DOCKER_PROXY_REGISTRY_URL }}" + "CENTREON_VERSION=${{ needs.get-environment.outputs.major_version }}" pull: true push: true - tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/gorgone-testing-${{ matrix.distrib }}:${{ needs.get-environment.outputs.gorgone_docker_version }} + tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/gorgone-testing-${{ matrix.distrib }}:${{ needs.get-environment.outputs.major_version }} From 42d464a43b0e5ef3903910b2ae34a2d4859c1699 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Fri, 8 Nov 2024 14:25:53 +0100 Subject: [PATCH 02/12] fix version argument --- .github/docker/Dockerfile.gorgone-testing-alma8 | 5 ++--- .github/docker/Dockerfile.gorgone-testing-alma9 | 7 +++---- .github/docker/Dockerfile.gorgone-testing-bookworm | 8 ++++---- .github/docker/Dockerfile.gorgone-testing-bullseye | 5 ++--- .github/docker/Dockerfile.gorgone-testing-jammy | 5 ++--- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-alma8 b/.github/docker/Dockerfile.gorgone-testing-alma8 index bdf2ef9a613..689395ff9dc 100644 --- a/.github/docker/Dockerfile.gorgone-testing-alma8 +++ b/.github/docker/Dockerfile.gorgone-testing-alma8 @@ -1,16 +1,15 @@ ARG REGISTRY_URL=docker.io -ARG CENTREON_VERSION FROM ${REGISTRY_URL}/almalinux:8 -ENV REPO_VERSION=${CENTREON_VERSION} +ARG CENTREON_VERSION RUN bash -e < /dev/null 2>&1 +apt-update + apt-get clean rm -rf /var/lib/apt/lists/* diff --git a/.github/docker/Dockerfile.gorgone-testing-bullseye b/.github/docker/Dockerfile.gorgone-testing-bullseye index 1d825fd7ba8..72ea67f9ded 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bullseye +++ b/.github/docker/Dockerfile.gorgone-testing-bullseye @@ -1,9 +1,8 @@ ARG REGISTRY_URL=docker.io -ARG CENTREON_VERSION FROM ${REGISTRY_URL}/debian:bullseye -ENV REPO_VERSION=${CENTREON_VERSION} +ARG CENTREON_VERSION ENV DEBIAN_FRONTEND noninteractive # fix locale @@ -23,7 +22,7 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 pip3 install robotframework robotframework-examples robotframework-databaselibrary \ pymysql robotframework-requests robotframework-jsonlibrary -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${REPO_VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list +lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${CENTREON_VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ % main' | tee /etc/apt/sources.list.d/centreon-plugins.list wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 diff --git a/.github/docker/Dockerfile.gorgone-testing-jammy b/.github/docker/Dockerfile.gorgone-testing-jammy index cb86abd4aed..6cb3fe91b08 100644 --- a/.github/docker/Dockerfile.gorgone-testing-jammy +++ b/.github/docker/Dockerfile.gorgone-testing-jammy @@ -1,9 +1,8 @@ ARG REGISTRY_URL=docker.io -ARG CENTREON_VERSION FROM ${REGISTRY_URL}/ubuntu:jammy -ENV REPO_VERSION=${CENTREON_VERSION} +ARG CENTREON_VERSION ENV DEBIAN_FRONTEND=noninteractive @@ -16,7 +15,7 @@ RUN apt-get update && \ ENV LANG=en_US.UTF-8 # Add Centreon repositories and their public key -RUN echo "deb https://packages.centreon.com/ubuntu-standard-${REPO_VERSION}-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-testing.list && \ +RUN echo "deb https://packages.centreon.com/ubuntu-standard-${CENTREON_VERSION}-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-testing.list && \ echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-plugins-testing.list && \ wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 && \ apt-get update From 924ce6ed0081ebbf4ada8db3721899b423114f2c Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 08:54:10 +0100 Subject: [PATCH 03/12] update el images for internal repos --- .github/docker/Dockerfile.gorgone-testing-alma8 | 7 ++++++- .github/docker/Dockerfile.gorgone-testing-alma9 | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-alma8 b/.github/docker/Dockerfile.gorgone-testing-alma8 index 689395ff9dc..d35a667624b 100644 --- a/.github/docker/Dockerfile.gorgone-testing-alma8 +++ b/.github/docker/Dockerfile.gorgone-testing-alma8 @@ -9,7 +9,12 @@ RUN bash -e < /dev/null; then + internal_repo="" +else + internal_repo="-internal" +fi +dnf -y config-manager --add-repo https://packages.centreon.com/rpm-standard$internal_repo/${CENTREON_VERSION}/el8/centreon-${CENTREON_VERSION}.repo dnf -y clean all --enablerepo=* dnf install -y python3.11 python3.11-pip pip3.11 install robotframework robotframework-examples robotframework-databaselibrary pymysql robotframework-requests robotframework-jsonlibrary diff --git a/.github/docker/Dockerfile.gorgone-testing-alma9 b/.github/docker/Dockerfile.gorgone-testing-alma9 index 54de61aa6b4..db70af18925 100644 --- a/.github/docker/Dockerfile.gorgone-testing-alma9 +++ b/.github/docker/Dockerfile.gorgone-testing-alma9 @@ -4,11 +4,16 @@ FROM ${REGISTRY_URL}/almalinux:9 ARG CENTREON_VERSION -RUN bash -c < /dev/null; then + internal_repo="" +else + internal_repo="-internal" +fi +dnf config-manager --add-repo https://packages.centreon.com/rpm-standard$internal_repo/${CENTREON_VERSION}/el9/centreon-${CENTREON_VERSION}.repo dnf install -y python3.11 python3.11-pip pip3.11 install robotframework robotframework-examples robotframework-databaselibrary pymysql robotframework-requests robotframework-jsonlibrary From c7a26dfa11dcb466845a89db13461f3d37456b10 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 11:33:48 +0100 Subject: [PATCH 04/12] update for cloud versions --- .../docker/Dockerfile.gorgone-testing-alma8 | 20 ++++++++++++------- .../docker/Dockerfile.gorgone-testing-alma9 | 20 ++++++++++++------- .../Dockerfile.gorgone-testing-bookworm | 5 +++-- .../Dockerfile.gorgone-testing-bullseye | 5 +++-- .../docker/Dockerfile.gorgone-testing-jammy | 5 +++-- .github/workflows/docker-gorgone-testing.yml | 6 +++++- 6 files changed, 40 insertions(+), 21 deletions(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-alma8 b/.github/docker/Dockerfile.gorgone-testing-alma8 index d35a667624b..0eacfbc3b99 100644 --- a/.github/docker/Dockerfile.gorgone-testing-alma8 +++ b/.github/docker/Dockerfile.gorgone-testing-alma8 @@ -1,21 +1,27 @@ ARG REGISTRY_URL=docker.io +ARG VERSION FROM ${REGISTRY_URL}/almalinux:8 -ARG CENTREON_VERSION +ARG VERSION +ARG IS_CLOUD -RUN bash -e < /dev/null; then - internal_repo="" + +if [[ "${IS_CLOUD}" == "true" ]]; then + dnf config-manager --add-repo https://$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_USERNAME):$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_PASSWORD)@packages.centreon.com/rpm-standard-internal/${VERSION}/el8/centreon-${VERSION}-internal.repo + sed -i "s#packages.centreon.com/rpm-standard-internal#$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_USERNAME):$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_PASSWORD)@packages.centreon.com/rpm-standard-internal#" /etc/yum.repos.d/centreon-${VERSION}-internal.repo else - internal_repo="-internal" + dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/${VERSION}/el8/centreon-${VERSION}.repo fi -dnf -y config-manager --add-repo https://packages.centreon.com/rpm-standard$internal_repo/${CENTREON_VERSION}/el8/centreon-${CENTREON_VERSION}.repo -dnf -y clean all --enablerepo=* +dnf config-manager --set-enabled 'centreon*' + dnf install -y python3.11 python3.11-pip pip3.11 install robotframework robotframework-examples robotframework-databaselibrary pymysql robotframework-requests robotframework-jsonlibrary diff --git a/.github/docker/Dockerfile.gorgone-testing-alma9 b/.github/docker/Dockerfile.gorgone-testing-alma9 index db70af18925..d2e09903f16 100644 --- a/.github/docker/Dockerfile.gorgone-testing-alma9 +++ b/.github/docker/Dockerfile.gorgone-testing-alma9 @@ -1,23 +1,29 @@ ARG REGISTRY_URL=docker.io +ARG VERSION FROM ${REGISTRY_URL}/almalinux:9 -ARG CENTREON_VERSION +ARG VERSION +ARG IS_CLOUD -RUN bash -e < /dev/null; then - internal_repo="" + +if [[ "${IS_CLOUD}" == "true" ]]; then + dnf config-manager --add-repo https://$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_USERNAME):$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_PASSWORD)@packages.centreon.com/rpm-standard-internal/${VERSION}/el9/centreon-${VERSION}-internal.repo + sed -i "s#packages.centreon.com/rpm-standard-internal#$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_USERNAME):$(cat /run/secrets/ARTIFACTORY_INTERNAL_REPO_PASSWORD)@packages.centreon.com/rpm-standard-internal#" /etc/yum.repos.d/centreon-${VERSION}-internal.repo else - internal_repo="-internal" + dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/${VERSION}/el9/centreon-${VERSION}.repo fi -dnf config-manager --add-repo https://packages.centreon.com/rpm-standard$internal_repo/${CENTREON_VERSION}/el9/centreon-${CENTREON_VERSION}.repo +dnf config-manager --set-enabled 'centreon*' + dnf install -y python3.11 python3.11-pip pip3.11 install robotframework robotframework-examples robotframework-databaselibrary pymysql robotframework-requests robotframework-jsonlibrary - dnf clean all EOF diff --git a/.github/docker/Dockerfile.gorgone-testing-bookworm b/.github/docker/Dockerfile.gorgone-testing-bookworm index b5f631c616d..02417281e24 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bookworm +++ b/.github/docker/Dockerfile.gorgone-testing-bookworm @@ -1,8 +1,9 @@ ARG REGISTRY_URL=docker.io +ARG VERSION FROM ${REGISTRY_URL}/debian:bookworm -ARG CENTREON_VERSION +ARG VERSION ENV DEBIAN_FRONTEND=noninteractive @@ -23,7 +24,7 @@ robotframework robotframework-examples robotframework-databaselibrary \ pymysql robotframework-requests robotframework-jsonlibrary # can't use \$() method it would be executed before the main script, and lsb_release would not be installed. -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${CENTREON_VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list +lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ % main' | tee /etc/apt/sources.list.d/centreon-plugins.list wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 apt-update diff --git a/.github/docker/Dockerfile.gorgone-testing-bullseye b/.github/docker/Dockerfile.gorgone-testing-bullseye index 72ea67f9ded..ecd00192bfb 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bullseye +++ b/.github/docker/Dockerfile.gorgone-testing-bullseye @@ -1,8 +1,9 @@ ARG REGISTRY_URL=docker.io +ARG VERSION FROM ${REGISTRY_URL}/debian:bullseye -ARG CENTREON_VERSION +ARG VERSION ENV DEBIAN_FRONTEND noninteractive # fix locale @@ -22,7 +23,7 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 pip3 install robotframework robotframework-examples robotframework-databaselibrary \ pymysql robotframework-requests robotframework-jsonlibrary -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${CENTREON_VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list +lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ % main' | tee /etc/apt/sources.list.d/centreon-plugins.list wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 diff --git a/.github/docker/Dockerfile.gorgone-testing-jammy b/.github/docker/Dockerfile.gorgone-testing-jammy index 6cb3fe91b08..ae5433106f5 100644 --- a/.github/docker/Dockerfile.gorgone-testing-jammy +++ b/.github/docker/Dockerfile.gorgone-testing-jammy @@ -1,8 +1,9 @@ ARG REGISTRY_URL=docker.io +ARG VERSION FROM ${REGISTRY_URL}/ubuntu:jammy -ARG CENTREON_VERSION +ARG VERSION ENV DEBIAN_FRONTEND=noninteractive @@ -15,7 +16,7 @@ RUN apt-get update && \ ENV LANG=en_US.UTF-8 # Add Centreon repositories and their public key -RUN echo "deb https://packages.centreon.com/ubuntu-standard-${CENTREON_VERSION}-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-testing.list && \ +RUN echo "deb https://packages.centreon.com/ubuntu-standard-${VERSION}-unstable/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-testing.list && \ echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ jammy main" | tee -a /etc/apt/sources.list.d/centreon-plugins-testing.list && \ wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 && \ apt-get update diff --git a/.github/workflows/docker-gorgone-testing.yml b/.github/workflows/docker-gorgone-testing.yml index 695917a7a45..ec8b71f9932 100644 --- a/.github/workflows/docker-gorgone-testing.yml +++ b/.github/workflows/docker-gorgone-testing.yml @@ -55,7 +55,11 @@ jobs: context: . build-args: | "REGISTRY_URL=${{ vars.DOCKER_PROXY_REGISTRY_URL }}" - "CENTREON_VERSION=${{ needs.get-environment.outputs.major_version }}" + "VERSION=${{ needs.get-environment.outputs.major_version }}" + "IS_CLOUD=${{ needs.get-environment.outputs.is_cloud }}" pull: true push: true tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/gorgone-testing-${{ matrix.distrib }}:${{ needs.get-environment.outputs.major_version }} + secrets: | + "ARTIFACTORY_INTERNAL_REPO_USERNAME=${{ secrets.ARTIFACTORY_INTERNAL_REPO_USERNAME }}" + "ARTIFACTORY_INTERNAL_REPO_PASSWORD=${{ secrets.ARTIFACTORY_INTERNAL_REPO_PASSWORD }}" From c91b47c97fc48ba8b6f21ec5f2bdc39156ca4589 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 11:44:29 +0100 Subject: [PATCH 05/12] update bookworm --- .github/docker/Dockerfile.gorgone-testing-bookworm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-bookworm b/.github/docker/Dockerfile.gorgone-testing-bookworm index 02417281e24..34b99e5b513 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bookworm +++ b/.github/docker/Dockerfile.gorgone-testing-bookworm @@ -23,9 +23,14 @@ pip3 install --break-system-packages --no-cache-dir \ robotframework robotframework-examples robotframework-databaselibrary \ pymysql robotframework-requests robotframework-jsonlibrary +VERSION_CODENAME=\$( + . /etc/os-release + echo \$VERSION_CODENAME +) + # can't use \$() method it would be executed before the main script, and lsb_release would not be installed. -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${VERSION}-unstable/ % main' | tee /etc/apt/sources.list.d/centreon.list -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ % main' | tee /etc/apt/sources.list.d/centreon-plugins.list +lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${VERSION}-unstable/ \$VERSION_CODENAME main' | tee /etc/apt/sources.list.d/centreon.list +lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ \$VERSION_CODENAME main' | tee /etc/apt/sources.list.d/centreon-plugins.list wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 apt-update From 20656698b74b8f3913aefecf206b4bcb74452034 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 11:55:17 +0100 Subject: [PATCH 06/12] update bookworm repos and gpg key --- .github/docker/Dockerfile.gorgone-testing-bookworm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-bookworm b/.github/docker/Dockerfile.gorgone-testing-bookworm index 34b99e5b513..89e6486265e 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bookworm +++ b/.github/docker/Dockerfile.gorgone-testing-bookworm @@ -28,10 +28,14 @@ VERSION_CODENAME=\$( echo \$VERSION_CODENAME ) -# can't use \$() method it would be executed before the main script, and lsb_release would not be installed. -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-standard-${VERSION}-unstable/ \$VERSION_CODENAME main' | tee /etc/apt/sources.list.d/centreon.list -lsb_release -sc | xargs -I % sh -c 'echo deb https://packages.centreon.com/apt-plugins-stable/ \$VERSION_CODENAME main' | tee /etc/apt/sources.list.d/centreon-plugins.list -wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 +echo "deb https://packages.centreon.com/apt-standard-${VERSION}-stable/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-stable.list +echo "deb https://packages.centreon.com/apt-standard-${VERSION}-testing/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-testing.list +echo "deb https://packages.centreon.com/apt-standard-${VERSION}-unstable/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-unstable.list +echo "deb https://packages.centreon.com/apt-plugins-stable/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-plugins-stable.list +echo "deb https://packages.centreon.com/apt-plugins-testing/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-plugins-testing.list +echo "deb https://packages.centreon.com/apt-plugins-unstable/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-plugins-unstable.list +wget -O- https://packages.centreon.com/api/security/keypair/APT-GPG-KEY/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 + apt-update apt-get clean From 791eb4a044e1c25c52092ade97d01b56932d9041 Mon Sep 17 00:00:00 2001 From: sdepassio <114986849+sdepassio@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:44:42 +0100 Subject: [PATCH 07/12] Update Dockerfile.gorgone-testing-bookworm --- .github/docker/Dockerfile.gorgone-testing-bookworm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/docker/Dockerfile.gorgone-testing-bookworm b/.github/docker/Dockerfile.gorgone-testing-bookworm index 89e6486265e..6edb9d8a2d0 100644 --- a/.github/docker/Dockerfile.gorgone-testing-bookworm +++ b/.github/docker/Dockerfile.gorgone-testing-bookworm @@ -36,7 +36,7 @@ echo "deb https://packages.centreon.com/apt-plugins-testing/ \$VERSION_CODENAME echo "deb https://packages.centreon.com/apt-plugins-unstable/ \$VERSION_CODENAME main" | tee -a /etc/apt/sources.list.d/centreon-plugins-unstable.list wget -O- https://packages.centreon.com/api/security/keypair/APT-GPG-KEY/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1 -apt-update +apt-get update apt-get clean rm -rf /var/lib/apt/lists/* From 7241a3d57ca96289dcd1ec7ffe3160539c82cc9b Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 14:52:10 +0100 Subject: [PATCH 08/12] Update docker image tag used for tests --- .github/workflows/gorgone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gorgone.yml b/.github/workflows/gorgone.yml index 56051f01b60..67bca200f48 100644 --- a/.github/workflows/gorgone.yml +++ b/.github/workflows/gorgone.yml @@ -155,7 +155,7 @@ jobs: runs-on: ubuntu-24.04 container: - image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ needs.get-environment.outputs.gorgone_docker_version }} + image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ needs.get-environment.outputs.major_version }} credentials: username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} From 287db3d9e70fffd9702eca5cdb917bb627335c96 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 14:54:19 +0100 Subject: [PATCH 09/12] run workflow when workflow is updated --- .github/workflows/gorgone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gorgone.yml b/.github/workflows/gorgone.yml index 67bca200f48..dd90f88d00f 100644 --- a/.github/workflows/gorgone.yml +++ b/.github/workflows/gorgone.yml @@ -13,6 +13,7 @@ on: - reopened - ready_for_review paths: + - ".github/workflows/gorgone.yml" - "gorgone/**" - "!gorgone/tests/**" - "!gorgone/veracode.json" From f5c4a7bc8a481c0e0cfdb89a79a70323b00739c0 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 14:57:03 +0100 Subject: [PATCH 10/12] activate gorgone tests --- .github/workflows/gorgone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/gorgone.yml b/.github/workflows/gorgone.yml index dd90f88d00f..d04cc1553bf 100644 --- a/.github/workflows/gorgone.yml +++ b/.github/workflows/gorgone.yml @@ -133,7 +133,6 @@ jobs: stability: ${{ needs.get-environment.outputs.stability }} test-gorgone: - if: false needs: [get-environment, package] strategy: From e8f445cdb5d2325c13b13d657df4e90a5f197e9b Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 15:36:47 +0100 Subject: [PATCH 11/12] removing jammy --- .github/workflows/gorgone.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/gorgone.yml b/.github/workflows/gorgone.yml index d04cc1553bf..a10a463bc2d 100644 --- a/.github/workflows/gorgone.yml +++ b/.github/workflows/gorgone.yml @@ -74,9 +74,6 @@ jobs: - package_extension: deb image: packaging-nfpm-bookworm distrib: bookworm - - package_extension: deb - image: packaging-nfpm-jammy - distrib: jammy runs-on: ubuntu-24.04 @@ -146,9 +143,6 @@ jobs: - package_extension: rpm image: gorgone-testing-alma9 distrib: el9 - - package_extension: deb - image: gorgone-testing-jammy - distrib: jammy - package_extension: deb image: gorgone-testing-bookworm distrib: bookworm From 0dca1417d30b7f9168027dc17f77d2840bbd6d2f Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Tue, 12 Nov 2024 18:25:04 +0100 Subject: [PATCH 12/12] removing unused gorgone_docker_version --- .github/workflows/get-environment.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/get-environment.yml b/.github/workflows/get-environment.yml index c33fad5fe5f..2c34f969fc1 100644 --- a/.github/workflows/get-environment.yml +++ b/.github/workflows/get-environment.yml @@ -39,9 +39,6 @@ on: test_img_version: description: "test docker image version (checksum of database sql, script and dockerfiles)" value: ${{ jobs.get-environment.outputs.test_img_version }} - gorgone_docker_version: - description: "md5 of gorgone dockerfile" - value: ${{ jobs.get-environment.outputs.gorgone_docker_version }} jobs: get-environment: @@ -58,7 +55,6 @@ jobs: is_targeting_feature_branch: ${{ steps.get_stability.outputs.is_targeting_feature_branch }} img_version: ${{ steps.get_docker_images_version.outputs.img_version }} test_img_version: ${{ steps.get_docker_images_version.outputs.test_img_version }} - gorgone_docker_version: ${{ steps.get_docker_images_version.outputs.gorgone_docker_version }} steps: - name: Checkout sources (current branch) @@ -239,9 +235,6 @@ jobs: TEST_IMG_VERSION=$(cat .github/docker/Dockerfile.centreon-collect-*-test .github/scripts/collect-prepare-test-robot.sh resources/*.sql | md5sum | cut -c1-8) echo "test_img_version=$TEST_IMG_VERSION" >> $GITHUB_OUTPUT - GORGONE_DOCKER_VERSION=$(cat .github/docker/Dockerfile.gorgone-testing-* | md5sum | cut -c1-8) - echo "gorgone_docker_version=$GORGONE_DOCKER_VERSION" >> $GITHUB_OUTPUT - - name: Display info in job summary uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 env: @@ -260,7 +253,6 @@ jobs: ['is_targeting_feature_branch', '${{ steps.get_stability.outputs.is_targeting_feature_branch }}'], ['img_version', '${{ steps.get_docker_images_version.outputs.img_version }}'], ['test_img_version', '${{ steps.get_docker_images_version.outputs.test_img_version }}'], - ['gorgone_docker_version', '${{ steps.get_docker_images_version.outputs.gorgone_docker_version }}'], ]; outputTable.push(['target_stability', '${{ steps.get_stability.outputs.target_stability || 'not defined because current run is not triggered by pull request event' }}']);