test(ci): generate perl-crypt-openssl-aes for el7 #412
Workflow file for this run
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
name: perl-cpan-libraries | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- ".github/workflows/perl-cpan-libraries.yml" | |
push: | |
branches: | |
- develop | |
- dev-[2-9][0-9].[0-9][0-9].x | |
- master | |
- "[2-9][0-9].[0-9][0-9].x" | |
paths: | |
- ".github/workflows/perl-cpan-libraries.yml" | |
jobs: | |
get-environment: | |
uses: ./.github/workflows/get-environment.yml | |
package-rpm: | |
needs: [get-environment] | |
if: | | |
needs.get-environment.outputs.skip_workflow == 'false' && | |
needs.get-environment.outputs.stability != 'stable' | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
distrib: [el7] | |
name: | |
[ | |
"Crypt::OpenSSL::AES", | |
] | |
include: | |
- build_distribs: "el7" | |
- rpm_dependencies: "" | |
- rpm_provides: "" | |
- version: "0.21" | |
- spec_file: "" | |
- distrib: el7 | |
package_extension: rpm | |
image: packaging-plugins-centos7 | |
name: package ${{ matrix.distrib }} ${{ matrix.name }} | |
container: | |
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest | |
credentials: | |
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }} | |
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }} | |
steps: | |
- run: git clone https://github.com/centreon/centreon-plugins.git --branch generate-perl-crypt-openssl-aes --single-branch | |
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }} | |
run: | | |
# BASE CENTOS 7 REPOSITORIES | |
for file in $(grep -l mirrorlist /etc/yum.repos.d/CentOS-*);do | |
if [[ "$file" == "/etc/yum.repos.d/CentOS-CR.repo" ]];then | |
echo "Enabling vault.centos.org in $file" | |
sed -i 's/baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
else | |
echo "Disabling mirrorlist.centos.org in $file" | |
sed -i 's/mirrorlist\=/\#mirrorlist\=/g' $file | |
echo "Enabling vault.centos.org in $file" | |
sed -i 's/\#baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
fi | |
done | |
# SOFTWARE COLLECTION CENTOS 7 REPOSITORIES | |
for file in $(grep -l mirrorlist /etc/yum.repos.d/CentOS-SCLo*);do | |
echo "Disabling mirrorlist.centos.org in $file" | |
sed -i 's/mirrorlist\=/\#mirrorlist\=/g' $file | |
if [[ "$file" == "/etc/yum.repos.d/CentOS-SCLo-scl.repo" ]];then | |
echo "Enabling vault.centos.org in scl." | |
sed -i 's/\#\ baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
elif [[ "$file" == "/etc/yum.repos.d/CentOS-SCLo-scl-rh.repo" ]];then | |
echo "Enabling vault.centos.org in scl-rh" | |
sed -i 's/\#baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
else | |
echo "Not a SCL repo file" | |
fi | |
done | |
yum install -y yum-utils epel-release git | |
yum config-manager --set-enabled crb || true # alma 9 | |
yum config-manager --set-enabled powertools || true # alma 8 | |
yum install -y cpanminus rpm-build libcurl-devel libssh-devel expat-devel gcc libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny | |
# yum module reset -y ruby | |
# yum module enable -y ruby:3.1 | |
# yum install -y ruby ruby-devel | |
yum install -y centos-release-scl-rh | |
# BASE CENTOS 7 REPOSITORIES | |
for file in $(grep -l mirrorlist /etc/yum.repos.d/CentOS-*);do | |
if [[ "$file" == "/etc/yum.repos.d/CentOS-CR.repo" ]];then | |
echo "Enabling vault.centos.org in $file" | |
sed -i 's/baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
else | |
echo "Disabling mirrorlist.centos.org in $file" | |
sed -i 's/mirrorlist\=/\#mirrorlist\=/g' $file | |
echo "Enabling vault.centos.org in $file" | |
sed -i 's/\#baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
fi | |
done | |
# SOFTWARE COLLECTION CENTOS 7 REPOSITORIES | |
for file in $(grep -l mirrorlist /etc/yum.repos.d/CentOS-SCLo*);do | |
echo "Disabling mirrorlist.centos.org in $file" | |
sed -i 's/mirrorlist\=/\#mirrorlist\=/g' $file | |
if [[ "$file" == "/etc/yum.repos.d/CentOS-SCLo-scl.repo" ]];then | |
echo "Enabling vault.centos.org in scl." | |
sed -i 's/\#\ baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
elif [[ "$file" == "/etc/yum.repos.d/CentOS-SCLo-scl-rh.repo" ]];then | |
echo "Enabling vault.centos.org in scl-rh" | |
sed -i 's/\#baseurl\=http\:\/\/mirror\.centos\.org/baseurl\=http\:\/\/vault\.centos\.org/g' $file | |
else | |
echo "Not a SCL repo file" | |
fi | |
done | |
yum install -y devtoolset-7-gcc-c++ | |
yum install -y rbenv | |
CC=/opt/rh/devtoolset-7/root/usr/bin/gcc rbenv install 3.1.4 -v | |
shell: bash | |
- run: git clone https://github.com/kduret/fpm.git --branch fix-rpm-perl-dependency-name-unchanged --single-branch fpm | |
# - if: ${{ contains(matrix.build_distribs, matrix.distrib) }} | |
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
# with: | |
# repository: kduret/fpm | |
# ref: fix-rpm-perl-dependency-name-unchanged | |
# path: fpm | |
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }} | |
name: Build and install fpm # waiting https://github.com/jordansissel/fpm/pull/2066 | |
run: | | |
yum install -y bsdtar | |
cd fpm | |
gem install bundler | |
bundle install | |
make install | |
shell: bash | |
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file == '' }} | |
run: | | |
if [ -z "${{ matrix.version }}" ]; then | |
PACKAGE_VERSION="" | |
else | |
PACKAGE_VERSION=" -v ${{ matrix.version }}" | |
fi | |
if [ -z "${{ matrix.rpm_dependencies }}" ]; then | |
PACKAGE_DEPENDENCIES="" | |
else | |
for PACKAGE_DEPENDENCY in `echo "${{ matrix.rpm_dependencies }}"`; do | |
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends "$PACKAGE_DEPENDENCY"" | |
done | |
fi | |
if [ -z "${{ matrix.rpm_provides }}" ]; then | |
PACKAGE_PROVIDES="" | |
else | |
for PACKAGE_PROVIDE in `echo "${{ matrix.rpm_provides }}"`; do | |
PACKAGE_PROVIDES="$PACKAGE_PROVIDES --provides $PACKAGE_PROVIDE" | |
done | |
fi | |
cpanm Module::Build::Tiny | |
cpanm Module::Install | |
export SYBASE="/usr" | |
fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION ${{ matrix.name }} | |
shell: bash | |
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }} | |
name: Replace '::' with - in the feature path | |
id: package-name | |
run: | | |
name="${{ matrix.name }}" | |
name_with_dash="${name//::/-}" | |
echo "Modified Name: $name_with_dash" | |
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT | |
shell: bash | |
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }} | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }} | |
path: ./*.${{ matrix.package_extension }} | |
retention-days: 1 | |
merge-package-rpm-artifacts: | |
needs: [get-environment, package-rpm] | |
if: | | |
needs.get-environment.outputs.skip_workflow == 'false' && | |
needs.get-environment.outputs.stability != 'stable' | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
distrib: [el8, el9] | |
steps: | |
- name: Merge Artifacts | |
uses: actions/upload-artifact/merge@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: packages-rpm-${{ matrix.distrib }} | |
pattern: packages-rpm-${{ matrix.distrib }}-* | |
delete-merged: false # cannot be set to true due to random fails: Failed to DeleteArtifact: Unable to make request: ECONNRESET | |
retention-days: 1 | |
- name: Delete merged artifacts | |
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0 | |
with: | |
name: packages-rpm-${{ matrix.distrib }}-* | |
failOnError: false | |
sign-rpm: | |
needs: [get-environment, merge-package-rpm-artifacts] | |
if: | | |
needs.get-environment.outputs.skip_workflow == 'false' && | |
needs.get-environment.outputs.stability != 'stable' | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
distrib: [el8, el9] | |
name: sign rpm ${{ matrix.distrib }} | |
container: | |
image: docker.centreon.com/centreon-private/rpm-signing:latest | |
options: -t | |
credentials: | |
username: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_USERNAME }} | |
password: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_TOKEN }} | |
steps: | |
- run: apt-get install -y zstd | |
shell: bash | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: packages-rpm-${{ matrix.distrib }} | |
path: ./ | |
- run: echo "HOME=/root" >> $GITHUB_ENV | |
shell: bash | |
- run: rpmsign --addsign ./*.rpm | |
shell: bash | |
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ./*.rpm | |
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }} | |
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
with: | |
name: packages-signed-rpm-${{ matrix.distrib }} | |
path: ./*.rpm | |
retention-days: 1 |