Skip to content

Commit

Permalink
chore(git): move centreon-gorgone to centreon-collect repository [24.…
Browse files Browse the repository at this point in the history
…04] (#1532)
  • Loading branch information
kduret authored Jul 19, 2024
2 parents cde6152 + 5c809f7 commit d0d0128
Show file tree
Hide file tree
Showing 255 changed files with 50,871 additions and 90 deletions.
17 changes: 12 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
* @centreon/owners-cpp
* @centreon/owners-cpp

.github/** @centreon/owners-pipelines
packaging/** @centreon/owners-pipelines
selinux/** @centreon/owners-pipelines
.github/** @centreon/owners-pipelines
packaging/** @centreon/owners-pipelines
selinux/** @centreon/owners-pipelines

tests/** @centreon/owners-robot-e2e
tests/** @centreon/owners-robot-e2e

gorgone/ @centreon/owners-perl
gorgone/docs/ @centreon/owners-doc

gorgone/tests/robot/config/ @centreon/owners-perl
*.pm @centreon/owners-perl
*.pl @centreon/owners-perl
26 changes: 13 additions & 13 deletions .github/actions/delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
distrib:
description: "The distribution used for packaging"
required: true
version:
major_version:
description: "Centreon packaged major version"
required: true
cache_key:
Expand Down Expand Up @@ -60,15 +60,15 @@ runs:
FILES="*.${{ env.extfile }}"
# DEBUG
echo "[DEBUG] - Version: ${{ inputs.version }}"
echo "[DEBUG] - Major version: ${{ inputs.major_version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
echo "[DEBUG] - module_name: ${{ inputs.module_name }}"
echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}"
echo "[DEBUG] - release_type: ${{ inputs.release_type }}"
echo "[DEBUG] - stability: ${{ inputs.stability }}"
# Make sure all required inputs are NOT empty
if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then
if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.major_version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then
echo "Some mandatory inputs are empty, please check the logs."
exit 1
fi
Expand Down Expand Up @@ -96,19 +96,19 @@ runs:
if [[ ${{ inputs.release_cloud }} -eq 1 && ( ${{ inputs.release_type }} == "hotfix" || ${{ inputs.release_type }} == "release" ) ]]; then
echo "[DEBUG] : Release cloud + ${{ inputs.release_type }}, using rpm-standard-internal."
ROOT_REPO_PATHS="rpm-standard-internal"
UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}/"
UPLOAD_REPO_PATH="${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}/"
# CLOUD + NOT HOTFIX OR CLOUD + NOT RELEASE + REPO STANDARD INTERNAL
elif [[ ${{ inputs.release_cloud }} -eq 1 && ( ${{ inputs.release_type }} != "hotfix" && ${{ inputs.release_type }} != "release" ) ]]; then
echo "[DEBUG] : Release cloud + NOT ${{ inputs.release_type }}, using rpm-standard-internal."
ROOT_REPO_PATHS="rpm-standard-internal"
UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}/"
UPLOAD_REPO_PATH="${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}/"
# NON-CLOUD + (HOTFIX OR RELEASE) + REPO STANDARD
elif [[ ${{ inputs.release_cloud }} -eq 0 ]]; then
echo "[DEBUG] : NOT Release cloud + ${{ inputs.release_type }}, using rpm-standard."
ROOT_REPO_PATHS="rpm-standard"
UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/"
UPLOAD_REPO_PATH="${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/"
# NOT VALID, DO NOT DELIVER
else
Expand All @@ -125,7 +125,7 @@ runs:
elif [ "${{ inputs.stability }}" == "testing" ]; then
jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/$UPLOAD_REPO_PATH" --sync-deletes="$ROOT_REPO_PATH/$UPLOAD_REPO_PATH" --flat
else
jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --sync-deletes="$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat
jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --sync-deletes="$ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat
fi
fi
done
Expand All @@ -138,32 +138,32 @@ runs:
FILES="*.${{ env.extfile }}"
# DEBUG
echo "[DEBUG] - Version: ${{ inputs.version }}"
echo "[DEBUG] - Major version: ${{ inputs.major_version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
echo "[DEBUG] - module_name: ${{ inputs.module_name }}"
echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}"
echo "[DEBUG] - release_type: ${{ inputs.release_type }}"
echo "[DEBUG] - stability: ${{ inputs.stability }}"
# Make sure all required inputs are NOT empty
if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then
if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.major_version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then
echo "Some mandatory inputs are empty, please check the logs."
exit 1
fi
for FILE in $FILES; do
echo "[DEBUG] - File: $FILE"
VERSION=${{ inputs.version }}
VERSION=${{ inputs.major_version }}
DISTRIB=$(echo $FILE | cut -d '_' -f2 | cut -d '-' -f2)
ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1)
echo "[DEBUG] - Version: $VERSION"
echo "[DEBUG] - Major version: $VERSION"
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
ROOT_REPO_PATH="ubuntu-standard-${{ inputs.version }}-${{ inputs.stability }}"
ROOT_REPO_PATH="ubuntu-standard-${{ inputs.major_version }}-${{ inputs.stability }}"
else
ROOT_REPO_PATH="apt-standard-${{ inputs.version }}-${{ inputs.stability }}"
ROOT_REPO_PATH="apt-standard-${{ inputs.major_version }}-${{ inputs.stability }}"
fi
jf rt upload "$FILE" "$ROOT_REPO_PATH/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
Expand Down
32 changes: 29 additions & 3 deletions .github/actions/package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ inputs:
distrib:
description: The package distrib
required: true
version:
description: The package version
major_version:
description: The major version
required: false
minor_version:
description: The minor version
required: false
release:
description: The package release number
Expand Down Expand Up @@ -53,7 +56,8 @@ runs:
RPM_GPG_SIGNING_KEY_ID: ${{ inputs.rpm_gpg_signing_key_id }}
RPM_GPG_SIGNING_PASSPHRASE: ${{ inputs.rpm_gpg_signing_passphrase }}
run: |
export VERSION="${{ inputs.version }}"
export MAJOR_VERSION="${{ inputs.major_version }}"
export VERSION="${{ inputs.major_version }}.${{ inputs.minor_version }}"
export RELEASE="${{ inputs.release }}"
export ARCH="${{ inputs.arch }}"
Expand All @@ -68,6 +72,19 @@ runs:
fi
fi
MAJOR_LEFT=$( echo $MAJOR_VERSION | cut -d "." -f1 )
MAJOR_RIGHT=$( echo $MAJOR_VERSION | cut -d "-" -f1 | cut -d "." -f2 )
BUMP_MAJOR_RIGHT=$(( MAJOR_RIGHT_PART + 1 ))
if [ "$MAJOR_RIGHT" = "04" ]; then
BUMP_MAJOR_LEFT="$MAJOR_LEFT"
BUMP_MAJOR_RIGHT="10"
else
BUMP_MAJOR_LEFT=$(( $MAJOR_LEFT + 1 ))
BUMP_MAJOR_RIGHT="04"
fi
export NEXT_MAJOR_VERSION="$BUMP_MAJOR_LEFT.$BUMP_MAJOR_RIGHT"
export RPM_SIGNING_KEY_FILE="$(pwd)/key.gpg"
export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID"
export NFPM_RPM_PASSPHRASE="$RPM_GPG_SIGNING_PASSPHRASE"
Expand All @@ -91,3 +108,12 @@ runs:
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}

# Update if condition to true to get packages as artifacts
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: packages-${{ inputs.distrib }}
path: ./*.${{ inputs.package_extension}}
retention-days: 1
29 changes: 16 additions & 13 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ on:
jobs:
get-version:
uses: ./.github/workflows/get-version.yml
with:
version_file: CMakeLists.txt

unit-test:
needs: [get-version]
Expand All @@ -71,10 +73,10 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
Expand All @@ -93,7 +95,8 @@ jobs:
if: ${{ ! contains(fromJson('["stable"]'), needs.get-version.outputs.stability) }}
uses: ./.github/workflows/package-collect.yml
with:
version: ${{ needs.get-version.outputs.version }}.${{ needs.get-version.outputs.patch }}
major_version: ${{ needs.get-version.outputs.major_version }}
minor_version: ${{ needs.get-version.outputs.minor_version }}
img_version: ${{ needs.get-version.outputs.img_version }}
release: ${{ needs.get-version.outputs.release }}
commit_hash: ${{ github.sha }}
Expand All @@ -107,7 +110,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: centreon-collect

Expand All @@ -117,8 +120,8 @@ jobs:
bucket_directory: centreon-collect
module_directory: centreon-collect
module_name: centreon-collect
major_version: ${{ needs.get-version.outputs.version }}
minor_version: ${{ needs.get-version.outputs.patch }}
major_version: ${{ needs.get-version.outputs.major_version }}
minor_version: ${{ needs.get-version.outputs.minor_version }}
token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }}

deliver-rpm:
Expand All @@ -138,14 +141,14 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Publish RPM packages
uses: ./.github/actions/delivery
with:
module_name: collect
distrib: ${{ matrix.distrib }}
version: ${{ needs.get-version.outputs.version }}
major_version: ${{ needs.get-version.outputs.major_version }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.run_id }}-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-version.outputs.stability }}
Expand Down Expand Up @@ -173,14 +176,14 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Publish DEB packages
uses: ./.github/actions/delivery
with:
module_name: collect
distrib: ${{ matrix.distrib }}
version: ${{ needs.get-version.outputs.version }}
major_version: ${{ needs.get-version.outputs.major_version }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.run_id }}-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
stability: ${{ needs.get-version.outputs.stability }}
Expand All @@ -197,16 +200,16 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Promote ${{ matrix.distrib }} to stable
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module_name: collect
distrib: ${{ matrix.distrib }}
major_version: ${{ needs.get-version.outputs.version }}
minor_version: ${{ needs.get-version.outputs.patch }}
major_version: ${{ needs.get-version.outputs.major_version }}
minor_version: ${{ needs.get-version.outputs.minor_version }}
stability: ${{ needs.get-version.outputs.stability }}
github_ref_name: ${{ github.ref_name }}
release_type: ${{ needs.get-version.outputs.release_type }}
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/docker-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ on:
- develop
- dev-[2-9][0-9].[0-9][0-9].x
paths:
- '.github/docker/**'
- '.github/docker/Dockerfile.centreon-collect-*'
pull_request:
paths:
- '.github/docker/**'
- '.github/docker/Dockerfile.centreon-collect-*'

jobs:
get-version:
uses: ./.github/workflows/get-version.yml
with:
version_file: CMakeLists.txt

create-and-push-docker:
needs: [get-version]
Expand Down Expand Up @@ -90,26 +92,26 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}

- name: Login to Proxy Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}

- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Build image ${{ matrix.image }}:${{ matrix.tag }}
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
file: .github/docker/Dockerfile.${{ matrix.dockerfile }}
context: .
Expand Down
Loading

0 comments on commit d0d0128

Please sign in to comment.