SRE-2452 rpms: Script to build RPMs from scratch #50
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: RPM Build Script Test | |
on: | |
pull_request: | |
permissions: {} | |
jobs: | |
Run_in_docker: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# this should be aligned with OS Supported in the script | |
os: ["rockylinux:8.6", | |
"rockylinux:8.8", | |
"rockylinux:8.10", | |
"rockylinux:9.2", | |
"rockylinux:9.3", | |
"opensuse/leap:15.4", | |
"opensuse/leap:15.5"] | |
platform: ["amd64"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Shell Script in Docker | |
run: | | |
distro="${{ matrix.os }}" | |
distro_clean="${distro//[:\/]/_}" | |
rpm_dst=~/rpms/$distro_clean | |
check_docker_image_exists() { | |
local image=$1 | |
if docker manifest inspect "$image" > /dev/null 2>&1; then | |
return 0 # Image exists | |
else | |
return 1 # Image does not exist | |
fi | |
} | |
mkdir -p "$rpm_dst" | |
chmod 777 "$rpm_dst" | |
# Check if the Docker image exists before running it | |
if check_docker_image_exists "$distro"; then | |
docker run --rm -v "$rpm_dst":/root/rpms -v .:/daos $distro \ | |
/daos/utils/build_rpms_from_scratch.sh /root/rpms | |
else | |
echo "::warning::Warning: Docker image '$distro' does not exist. Skipping this step." | |
fi |