Skip to content

Commit

Permalink
Release #19044#
Browse files Browse the repository at this point in the history
* fix(ci)

* fix(ci): release simplified

* fix(ci): an infinite loop fixed in tests with mariadbd restart

* fix(delivery): add delivery to old yum repo (#456)

* enh(ci): rebuild yum metadata only one time (#463)

* fix(ci): fix workflow trigger on push dev-22.10.x (#466)

* enh(packaging): add rpm sign to workflow 2210 (#468)

* enh(ci): add repository_name and debian delivery 2210 (#476) (#478)

* enh(ci): add repository_name and delivery (#476)

* enh(ci): add branch stability and delivery

* remove duplicate code

* enable delivery tests

* add deb delivery debug

* add deb delivery debug

* fix credentials

* disable deb delivery tests & debug

* fix(ci): update debian delivery url for 22.10

* fix(broker/lua): repeated fields should be ok with streamconnector

* chore(doc): changelog updated
* cleanup(broker/lua): refacto of the code
* cleanup(broker/lua): deadcode removed

REFS: MON-15903

* enh(ci): remove buster from build and delivery (#471) (#472)

* enh(ci): remove buster from build and delivery

* remove buster dockerfile

* feat(chore): add Deepsource configuration file (#479)

* use RELEASE instead of DISTRIB in package naming (#481) (#484)

* fix(cmake): conan path added to cmake (#505)

* fix(ci): registry updated

* enh(ci): Add rpm delivery cleanup and structure (#499) 2210 (#500)

* enh(ci): Add rpm delivery cleanup and structure (#499)

* enh(ci): Add rpm delivery cleanup and structure

* Add version to delivery inputs

* Add condition to use sshkey for rpm delivery only

* Update delivery action

* Update action delivery

* Update action delivery

* Update action delivery

* Update action delivery

* Update action delivery

* Enable cleanup

* Update action.yml

* Update action.yml

* Update action.yml

* fix(ci): correct docker registry link (#494)

* fix(ci): correct docker registry link

* Update action.yml

Fix run folder naming

* fix(conan): path updated to find protoc

Co-authored-by: Charles Gautier <33026375+chgautier@users.noreply.github.com>
Co-authored-by: David Boucher <dboucher@centreon.com>

* Handle deb stable delivery conditionally 2210 (#508)

* fix(ci): handle debian stable delivery conditionally 2210

* Update debian delivery url

* enh(ci): remove paths to workflow files in workflows for components (#513) (#523)

* chore(license): update maintainer and email addresses (#532)

* Mon 16454 add alma 8 to centreon collect nightly tests (#506) (#519)

* enh(ci): Add alma8 to centreon-collect nightly

* Add job to robot-nightly workflow

* enable ci test branch

* Update robot nightly workflow

* add debug to get-packages

* Add release to github_env

* add delivery test

* Get pkg dir version name

* Fix url

* fix url

* make curl silent

* fix curl

* add mariadb client

* update get-packages

* disable nightly on alma 8

* update alma8 image

* Add MariaDB packages to alma8 dockerfile

* remove extra sudo

* update collect-test-robot.sh

* Remove duplicate Robot test job

* fix(ci/tests): attempt to upgrade grpc python library

* Install proper grpc version based on OS version id

* help cmake to find protoc

* disable delivery tests

* remove unused lines from actions

* Remove more unused lines

Co-authored-by: David Boucher <dboucher@centreon.com>

* chore(ci): Update delivery credentials (#543) (#544)

* chore(ci): Update delivery credentials (#543)

* Update delivery credentials

* Update delivery credentials and inputs

* Update deb delivery credentials

* Update .github/workflows/centreon-collect.yml

Co-authored-by: Kevin Duret <kduret@centreon.com>

---------

Co-authored-by: Kevin Duret <kduret@centreon.com>

* chore(ci): Add extra delivery to artifactory (#553)

* MON-17043 cache-name-rpmbuild shorten (#573)

REFS:MON-17043

* chore(ci): move to harbor docker registry (22.10) (#581)

* chore(license): update package licenses (#559)

* enh(ci): handle debian delivery failure 2210 (#603)

* enh(cmake): new cmake.sh version

* chore(ci): fix cache name

* chore(ci): fix cache name

* Update robot-nightly.yml

Disable nightly workflow

---------

Co-authored-by: David Boucher <dboucher@centreon.com>
Co-authored-by: tuntoja <58987095+tuntoja@users.noreply.github.com>
Co-authored-by: Kevin Duret <kduret@centreon.com>
Co-authored-by: Stéphane Chapron <34628915+sc979@users.noreply.github.com>
Co-authored-by: jean-christophe81 <98889244+jean-christophe81@users.noreply.github.com>
  • Loading branch information
6 people committed Mar 16, 2023
1 parent 9068fd5 commit 66321a1
Show file tree
Hide file tree
Showing 45 changed files with 891 additions and 981 deletions.
16 changes: 16 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version = 1

[[analyzers]]
name = "shell"
enabled = true

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"

[[analyzers]]
name = "cxx"
enabled = true
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Please include a short resume of the changes and what is the purpose of PR. Any

## Target serie

- [ ] 21.04.x
- [ ] 21.10.x
- [ ] 22.04.x
- [ ] 22.10.x (master)
- [ ] 22.10.x
- [ ] 23.04.x (master)

<h2> How this pull request can be tested ? </h2>

Expand Down
133 changes: 115 additions & 18 deletions .github/actions/delivery/action.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
name: "delivery"
description: "RPM and DEB packages delivery Centreon"
inputs:
module_name:
description: "The name of the module"
required: true
repository_name:
description: "The name of the repository"
required: true
distrib:
description: "The distribution used for packaging"
required: true
repos_username:
nexus_username:
description: "Artifact Manager technical username"
required: true
repos_password:
nexus_password:
description: "Artifact Manager technical password"
required: true
version:
description: "Centreon packaged version"
required: true
minor_version:
description: "Centreon packaged version"
required: true
release:
description: The release number
required: true
cache_key:
description: "The cached package key"
required: true
update_repo_path:
description: "The update repo script path"
required: true
cloudfront_id:
description: "The cloudfront ID for repo url"
required: true
yum_repo_address:
description: "The yum legacy repo address"
required: true
yum_repo_key:
description: "The yum repo key"
required: true
yum_repo_url:
description: "The legacy yum repo url"
required: true
artifactory_token:
description: "The token for artifactory"
required: true

runs:
using: "composite"
Expand All @@ -29,7 +59,7 @@ runs:
- name: Build name for DEB
shell: bash
if: ${{ inputs.distrib == 'buster' || inputs.distrib == 'bullseye' }}
if: ${{ inputs.distrib == 'bullseye' }}
run: |
echo "build=debbuild-centreon-collect" >> $GITHUB_ENV
echo "extfile=deb" >> $GITHUB_ENV
Expand All @@ -38,8 +68,15 @@ runs:
uses: actions/cache@v3
with:
path: ./*.${{ env.extfile }}
key: ${{ inputs.cache_key }}-${{ env.build }}-${{ inputs.distrib }}
restore-keys: ${{ inputs.cache_key }}-${{ env.build }}-${{ inputs.distrib }}
key: ${{ inputs.cache_key }}
restore-keys: ${{ inputs.cache_key }}

- name: Setup awscli
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo unzip -q awscliv2.zip
sudo ./aws/install
shell: bash

- name: Publish packages
run: |
Expand All @@ -52,35 +89,95 @@ runs:
echo "[DEBUG] - Branch name: $BRANCHNAME"
case "$BRANCHNAME" in
develop | dev-[2-9][0-9].[0-9][0-9].x)
REPO="unstable"
SUBREPO="unstable"
;;
release* | hotfix*)
REPO="testing"
SUBREPO="testing"
;;
master | [2-9][0-9].[0-9][0-9].x)
REPO="stable"
SUBREPO="stable"
;;
*)
echo -n "[INFO] NO DELIVERY FOR THIS BRANCH"
exit 0
;;
esac
FILES="*.${{ env.extfile }}";
DISTRIB="${{ inputs.distrib }}";
echo "[DEBUG] - Repo: $REPO"
echo "[DEBUG] - FILES: $FILES"
echo "[DEBUG] - DISTRIB: $DISTRIB"
if [[ "${{ env.extfile }}" == "rpm" ]] ; then
eval `ssh-agent`
ssh-add - <<< "${{ inputs.yum_repo_key }}"
fi
FILES="*.${{ env.extfile }}"
for FILE in $FILES
do
echo "[DEBUG] - File: $FILE"
VERSION=${{ inputs.version }}
MAJOR="$VERSION"
MINOR=${{ inputs.minor_version }}
RELEASE=${{ inputs.release }}
REPOTYPE="$SUBREPO"
PROJECT=${{ inputs.module_name }}
PROJECT_PATH="standard"
echo "[DEBUG] - Suprepo: $SUBREPO"
echo "[DEBUG] - Version: $VERSION"
if [[ "${{ env.extfile }}" == "deb" ]] ; then
echo "[DEBUG] - https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64"
curl -v -u "${{ inputs.repos_username }}":"${{ inputs.repos_password }}" -X PUT "https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64" -T "./$FILE"
if [[ "${{ env.extfile }}" == "deb" ]] && [[ "$SUBREPO" == "stable" ]]; then
curl --fail -u "${{ inputs.nexus_username }}":"${{ inputs.nexus_password }}" -H "Content-Type: multipart/form-data" --data-binary "@./$FILE" https://apt.centreon.com/repository/${{ inputs.version }}/
curl --fail -v -H "Authorization: Bearer ${{ inputs.artifactory_token }}" -X PUT "https://centreon.jfrog.io/artifactory/apt-${{ inputs.version }}-$SUBREPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64" -T "$FILE"
elif [[ "${{ env.extfile }}" == "deb" ]] && [[ "$SUBREPO" != "stable" ]]; then
curl --fail -u "${{ inputs.nexus_username }}":"${{ inputs.nexus_password }}" -H "Content-Type: multipart/form-data" --data-binary "@./$FILE" https://apt.centreon.com/repository/${{ inputs.version }}-$SUBREPO/
curl --fail -v -H "Authorization: Bearer ${{ inputs.artifactory_token }}" -X PUT "https://centreon.jfrog.io/artifactory/apt-${{ inputs.version }}-$SUBREPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64" -T "$FILE"
else
echo "[DEBUG] - https://artifactory.apps.centreon.com/artifactory/rpm-$VERSION-$REPO/$DISTRIB/$REPO/x86_64/centreon-collect"
curl -v -u "${{ inputs.repos_username }}":"${{ inputs.repos_password }}" -X PUT "https://artifactory.apps.centreon.com/artifactory/rpm-$VERSION-$REPO/$DISTRIB/$REPO/x86_64/centreon-collect/$FILE" -T "./$FILE"
DISTRIB="${{ inputs.distrib }}"
ARCH=$(echo $FILE | grep -oP '(x86_64|noarch)')
echo "[DEBUG] - DISTRIB: $DISTRIB"
echo "[DEBUG] - Arch: $ARCH"
if [[ "$SUBREPO" == "stable" ]] ; then
TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/RPMS"
curl --fail -v -H "Authorization: Bearer ${{ inputs.artifactory_token }}" -X PUT "https://centreon.jfrog.io/artifactory/rpm/$PROJECT_PATH/$MAJOR/$DISTRIB/$SUBREPO/$ARCH/$FILE" -T "./$FILE"
else
FOLDER="$PROJECT-$MAJOR.$MINOR-$RELEASE"
TARGET="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/$PROJECT/$FOLDER"
PROJECT_LOCATION="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/$PROJECT"
curl --fail -v -H "Authorization: Bearer ${{ inputs.artifactory_token }}" -X PUT "https://centreon.jfrog.io/artifactory/rpm/$PROJECT_PATH/$MAJOR/$DISTRIB/$SUBREPO/$ARCH/$PROJECT/$FOLDER/$FILE" -T "./$FILE"
fi
echo "[DEBUG] - Folder: $FOLDER"
echo "[DEBUG] - Project : $PROJECT"
echo "[DEBUG] - Target : $TARGET"
echo "[DEBUG] - PROJECT_LOCATION : $PROJECT_LOCATION"
ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" mkdir -p "$TARGET" 2>&-
scp -o StrictHostKeyChecking=no "$FILE" "${{ inputs.yum_repo_address }}:$TARGET" 2>&-
fi
done
# run this only for rpm
if [[ "${{ env.extfile }}" == "rpm" ]] ; then
# Cleanup is done on unstable repository only
if [[ "$SUBREPO" == "unstable" ]] ; then
ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" "ls -drc $PROJECT_LOCATION/* 2>&- | head -n -1 | xargs rm -rf"
fi
# Update repository metadata
METADATAS="/srv/centreon-yum/yum.centreon.com/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH"
ssh -o StrictHostKeyChecking=no "${{ inputs.yum_repo_address }}" "sh "${{ inputs.update_repo_path }}" $METADATAS" 2>&-
# Invalidate cloudfront cache
ID="${{ inputs.cloudfront_id }}"
PATHS="/$PROJECT_PATH/$MAJOR/$DISTRIB/$REPOTYPE/$ARCH/*"
ITERATIONS=1
until aws cloudfront create-invalidation --distribution-id "$ID" --paths "$PATHS"; do
if [ ${ITERATIONS} -eq 10 ]; then
return 0
fi
echo "couldn't invalidate cache, AWS quota might have been reached, retrying in 30 seconds..."
sleep 30s
ITERATIONS=$((ITERATIONS+1))
done
fi
shell: bash
92 changes: 92 additions & 0 deletions .github/actions/get-packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: "get-packages"
description: "Get RPM Centreon packages from the repository"
inputs:
distrib:
description: "The distribution used for packaging"
required: true
repos_username:
description: "Artifact Manager technical username"
required: true
repos_password:
description: "Artifact Manager technical password"
required: true
version:
description: "Centreon packaged version"
required: true
patch:
description: "Centreon packaged version patch"
required: true
release:
description: "Centreon packaged release"
required: true
cache_key:
description: "The cached package key"
required: true

runs:
using: "composite"
steps:
- name: Build name for RPM
shell: bash
if: ${{ inputs.distrib == 'el7' || inputs.distrib == 'el8' }}
run: |
echo "build=rpmbuild-centreon-collect" >> $GITHUB_ENV
echo "extfile=rpm" >> $GITHUB_ENV
- name: Build name for DEB
shell: bash
if: ${{ inputs.distrib == 'bullseye' }}
run: |
echo "build=debbuild-centreon-collect" >> $GITHUB_ENV
echo "extfile=deb" >> $GITHUB_ENV
- name: Get packages
run: |
if [[ -z "$GITHUB_HEAD_REF" ]];
then
BRANCHNAME="$GITHUB_REF_NAME"
else
BRANCHNAME="$GITHUB_HEAD_REF"
fi
echo "[DEBUG] - Branch name: $BRANCHNAME"
case "$BRANCHNAME" in
develop | dev-[2-9][0-9].[0-9][0-9].x)
REPO="unstable"
;;
release* | hotfix*)
REPO="testing"
;;
master | [2-9][0-9].[0-9][0-9].x)
REPO="stable"
;;
*)
echo -n "[INFO] NO DELIVERY FOR THIS BRANCH"
exit 0
;;
esac
FILES="centreon-broker centreon-broker-cbd centreon-broker-cbmod centreon-broker-core centreon-broker-storage centreon-clib centreon-collect centreon-collect-client centreon-connector centreon-connector-perl centreon-connector-ssh centreon-engine centreon-engine-daemon centreon-engine-extcommands"
FULL_VERSION="${{ inputs.version }}.${{ inputs.patch }}"
RELEASE="${{ inputs.release }}"
echo "[DEBUG] - FULL_VERSION: $FULL_VERSION"
echo "[DEBUG] - RELEASE: $RELEASE"
# Obtain latest version.patch-release
PKG_DIR_VERSION=$(curl -s "https://yum.centreon.com/standard/23.04/el7/unstable/x86_64/centreon-collect/" | sed -En 's/.*([2-9][0-9]\.[0-9][0-9]\.[[:digit:]]+-[[:digit:]]+\.[[a-z0-9]{7}).*/\1/p')
echo "[DEBUG] - PKG_DIR_VERSION: $PKG_DIR_VERSION"
# Fetch files from repo
for FILE in $FILES ; do
if [[ "${{ env.extfile }}" == "deb" ]] ; then
echo "[DEBUG] - https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64"
curl -v -u "${{ inputs.repos_username }}":"${{ inputs.repos_password }}" -X PUT "https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64" -T "./$FILE"
else
echo "[DEBUG] - https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
curl -s -JO "https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/centreon-collect-$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
fi
done
ls -l *.rpm
for i in *.rpm ; do file $i ; done
shell: bash
39 changes: 39 additions & 0 deletions .github/actions/package-sign/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: rpm-sign-in-docker
description: Run step in docker container
inputs:
script_name:
description: "script_name"
required: true
image_name:
description: "image_name"
required: true
image_version:
description: "image_version"
required: true
centreon_pat:
description: "Secret"
required: false
registry_url:
description: Docker registry url
required: true
registry_username:
description: Docker registry username
required: true
registry_password:
description: Docker registry password
required: true
params:
description: "params for script"
required: false
runs:
using: "composite"
steps:
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry_url }}
username: ${{ inputs.registry_username }}
password: ${{ inputs.registry_password }}

- run: docker run -i -e TOKEN=${{ inputs.centreon_pat }} --entrypoint /src/.github/scripts/${{ inputs.script_name }}.sh -v "$PWD:/src" ${{ inputs.registry_url }}/${{ inputs.image_name }}:${{ inputs.image_version}} ${{ inputs.params }}
shell: bash
7 changes: 4 additions & 3 deletions .github/actions/runner-docker/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "runner docker Centreon"
description: "runner docker Centreon"
inputs:
registry_url:
description: Docker registry url
required: true
script_name:
description: "script name"
required: true
Expand All @@ -16,11 +19,9 @@ inputs:
params:
description: "params for script"
required: false
env:
REGISTRY: registry-docker.centreon.com/docker-global

runs:
using: "composite"
steps:
- run: docker run -i --entrypoint ${{ inputs.script_name }}.sh -v "$PWD:/src" ${{ inputs.env_variable }} ${{ env.REGISTRY }}/${{ inputs.image_name }}:${{ inputs.image_version}} ${{ inputs.params }}
- run: docker run -i --entrypoint ${{ inputs.script_name }}.sh -v "$PWD:/src" ${{ inputs.env_variable }} ${{ inputs.registry_url }}/${{ inputs.image_name }}:${{ inputs.image_version}} ${{ inputs.params }}
shell: bash
5 changes: 5 additions & 0 deletions .github/scripts/rpm-signing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -ex
export GPG_TTY=$(tty)
rpmsign --addsign /src/*.rpm
Loading

0 comments on commit 66321a1

Please sign in to comment.