-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(packaging): package centreon-common in a dedicated workflow (#1886
- Loading branch information
Showing
75 changed files
with
714 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
name: centreon-common | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- "packaging/centreon-common/**" | ||
- "selinux/centreon-common/**" | ||
push: | ||
branches: | ||
- develop | ||
- dev-[2-9][0-9].[0-9][0-9].x | ||
- master | ||
- "[2-9][0-9].[0-9][0-9].x" | ||
paths: | ||
- "packaging/centreon-common/**" | ||
- "selinux/centreon-common/**" | ||
|
||
jobs: | ||
get-environment: | ||
uses: ./.github/workflows/get-environment.yml | ||
with: | ||
version_file: .version.centreon-common | ||
|
||
package: | ||
needs: [get-environment] | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- package_extension: rpm | ||
image: centreon-collect-alma8 | ||
distrib: el8 | ||
- package_extension: rpm | ||
image: centreon-collect-alma9 | ||
distrib: el9 | ||
- package_extension: deb | ||
image: centreon-collect-debian-bookworm | ||
distrib: bookworm | ||
- package_extension: deb | ||
image: centreon-collect-ubuntu-jammy | ||
distrib: jammy | ||
|
||
runs-on: ubuntu-24.04 | ||
|
||
container: | ||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ needs.get-environment.outputs.img_version }} | ||
credentials: | ||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} | ||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} | ||
|
||
name: package ${{ matrix.distrib }} | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: Generate selinux binaries | ||
if: ${{ matrix.package_extension == 'rpm' }} | ||
run: | | ||
cd selinux/centreon-common | ||
sed -i "s/@VERSION@/${{ needs.get-environment.outputs.major_version }}.${{ needs.get-environment.outputs.minor_version }}/g" *.te | ||
make -f /usr/share/selinux/devel/Makefile | ||
shell: bash | ||
|
||
- name: Remove selinux packaging files on debian | ||
if: ${{ matrix.package_extension == 'deb' }} | ||
run: rm -f packaging/centreon-common/*-selinux.yaml | ||
shell: bash | ||
|
||
- name: Package Centreon | ||
uses: ./.github/actions/package | ||
with: | ||
nfpm_file_pattern: "packaging/centreon-common/*.yaml" | ||
distrib: ${{ matrix.distrib }} | ||
package_extension: ${{ matrix.package_extension }} | ||
major_version: ${{ needs.get-environment.outputs.major_version }} | ||
minor_version: ${{ needs.get-environment.outputs.minor_version }} | ||
release: ${{ needs.get-environment.outputs.release }} | ||
arch: all | ||
commit_hash: ${{ github.sha }} | ||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }} | ||
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }} | ||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }} | ||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
|
||
deliver-rpm: | ||
runs-on: [self-hosted, common] | ||
needs: [get-environment, package] | ||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} | ||
|
||
strategy: | ||
matrix: | ||
distrib: [el8, el9] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: Delivery | ||
uses: ./.github/actions/rpm-delivery | ||
with: | ||
module_name: common | ||
distrib: ${{ matrix.distrib }} | ||
version: ${{ needs.get-environment.outputs.major_version }} | ||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | ||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
release_type: ${{ needs.get-environment.outputs.release_type }} | ||
is_cloud: ${{ needs.get-environment.outputs.is_cloud }} | ||
|
||
deliver-deb: | ||
runs-on: [self-hosted, common] | ||
needs: [get-environment, package] | ||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }} | ||
|
||
strategy: | ||
matrix: | ||
distrib: [bookworm, jammy] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: Delivery | ||
uses: ./.github/actions/deb-delivery | ||
with: | ||
module_name: common | ||
distrib: ${{ matrix.distrib }} | ||
version: ${{ needs.get-environment.outputs.major_version }} | ||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | ||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
release_type: ${{ needs.get-environment.outputs.release_type }} | ||
is_cloud: ${{ needs.get-environment.outputs.is_cloud }} | ||
|
||
promote: | ||
needs: [get-environment, deliver-deb, deliver-rpm] | ||
if: | | ||
(contains(fromJson('["stable", "testing"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') && | ||
! cancelled() && | ||
! contains(needs.*.result, 'failure') && | ||
! contains(needs.*.result, 'cancelled') | ||
runs-on: [self-hosted, common] | ||
strategy: | ||
matrix: | ||
distrib: [el8, el9, bookworm] | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
|
||
- name: Promote ${{ matrix.distrib }} to stable | ||
uses: ./.github/actions/promote-to-stable | ||
with: | ||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} | ||
module_name: common | ||
distrib: ${{ matrix.distrib }} | ||
major_version: ${{ needs.get-environment.outputs.major_version }} | ||
stability: ${{ needs.get-environment.outputs.stability }} | ||
github_ref_name: ${{ github.ref_name }} | ||
release_type: ${{ needs.get-environment.outputs.release_type }} | ||
is_cloud: ${{ needs.get-environment.outputs.is_cloud }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MINOR=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.