Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(centreon-vault): move vault lib to it's own package MON-106121 #5224

Closed
134 changes: 134 additions & 0 deletions .github/workflows/centreon-perl-common-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: centreon-perl-common-lib

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
workflow_dispatch:
pull_request:
paths:
- 'connectors/centreonPerlLibs/**'
push:
branches:
- develop
- master
paths:
- 'connectors/centreonPerlLibs/**'

jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
with:
version_file: connectors/centreonPerlLibs/version.yaml

package:
needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- package_extension: rpm
image: packaging-plugins-alma8
distrib: el8
- package_extension: rpm
image: packaging-plugins-alma9
distrib: el9
- package_extension: deb
image: packaging-plugins-bookworm
distrib: bookworm
- package_extension: deb
image: packaging-plugins-jammy
distrib: jammy

container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}

name: package ${{ matrix.distrib }}

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

- name: Package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "connectors/centreonPerlLibs/packaging/centreon-vault-common-lib.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
version: ${{ needs.get-environment.outputs.version }}
release: 1
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:
needs: [get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]

strategy:
matrix:
distrib: [el8, el9]

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

- name: Delivery
uses: ./.github/actions/rpm-delivery
with:
module_name: centreon-perl-common-lib
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

deliver-deb:
needs: [get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]

strategy:
matrix:
distrib: [bullseye, bookworm, jammy]

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

- name: Delivery
uses: ./.github/actions/deb-delivery
with:
module_name: centreon-perl-common-lib
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

promote:
needs: [get-environment]
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9, bullseye, bookworm]

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

- name: Promote ${{ matrix.distrib }} to stable
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module: centreon-perl-common
distrib: ${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "centreon-perl-common-lib"
arch: "all"
platform: "linux"
version_schema: "none"
version: "${VERSION}"
release: "${RELEASE}${DIST}"
section: "default"
priority: "optional"
maintainer: "Centreon <[email protected]>"
description: |
Perl library to communicate with an hashicorp vault API
Commit: @COMMIT_HASH@
vendor: "Centreon"
homepage: "https://centreon.com"
license: "Apache-2.0"

provides:
- centreon-perl-common-lib

contents:
- src: "../src/"
dst: "/usr/share/perl5/vendor_perl"
packager: rpm
- src: "../src/"
dst: "/usr/share/perl5"
packager: deb

overrides:
rpm:
depends:
- perl(Crypt::OpenSSL::AES)
- perl(JSON::XS)
- perl-Net-Curl
deb:
depends:
- libcrypt-openssl-aes-perl
- libio-socket-inet6-perl
- libjson-xs-perl
- libnet-curl-perl

rpm:
signature:
key_file: ${RPM_SIGNING_KEY_FILE}
key_id: ${RPM_SIGNING_KEY_ID}
Loading
Loading