diff --git a/.github/workflows/rpm-build.yml b/.github/workflows/rpm-build.yml index 06f8777..3acb8c6 100644 --- a/.github/workflows/rpm-build.yml +++ b/.github/workflows/rpm-build.yml @@ -307,14 +307,19 @@ jobs: id: build-rpm-docker-image continue-on-error: true run: set -x; cat ${{ inputs.PACKAGING_DIR }}/packaging/Dockerfile.mockbuild; - docker build --file ${{ inputs.PACKAGING_DIR }}/packaging/Dockerfile.mockbuild - --build-arg CACHEBUST=$(date +%s%3N) - --build-arg CB0=$(date +%V) - --build-arg REPO_FILE_URL=$REPO_FILE_URL - --build-arg UID=$(id -u) - --build-arg FVERSION=${{ env.FVERSION }} - --tag mock-build - ${{ inputs.PACKAGING_DIR }} + if command -v podman; then + DOCKER=podman + else + DOCKER=docker + fi + "$DOCKER" build --file ${{ inputs.PACKAGING_DIR }}/packaging/Dockerfile.mockbuild + --build-arg CACHEBUST=$(date +%s%3N) + --build-arg CB0=$(date +%V) + --build-arg REPO_FILE_URL=$REPO_FILE_URL + --build-arg UID=$(id -u) + --build-arg FVERSION=${{ env.FVERSION }} + --tag mock-build + ${{ inputs.PACKAGING_DIR }} - name: Build RPM id: build-rpm continue-on-error: true @@ -353,27 +358,32 @@ jobs: if [ -z "${{ github.run_attempt }}" ] || [ "${{ github.run_attempt }}" = '""' ]; then unique="$RANDOM" - docker_args=(--user build) else unique="${{ github.run_id }}-${{ github.run_attempt }}" + fi + if command -v podman; then + DOCKER=podman + else + DOCKER=docker + # TODO: determine why we cannot use this with podman docker_args=(--user build) fi - docker run --name mock-build-"$unique"-${{ matrix.distro }} \ - "${docker_args[@]}" \ - -v "$PWD":"$PWD" -w "$PWD" \ - -v "$PWD"/mock_result/${CHROOT_NAME}:/var/lib/mock/$CHROOT_NAME/result \ - -v /scratch:/scratch \ - --privileged=true \ - -e DAOS_FULLNAME="$DAOS_FULLNAME" \ - -e DAOS_EMAIL="$DAOS_EMAIL" \ - -e DISTRO_VERSION="$DISTRO_VERSION" \ - -e STAGE_NAME="$STAGE_NAME" \ - -e CHROOT_NAME="$CHROOT_NAME" \ - -e ARTIFACTORY_URL="$ARTIFACTORY_URL" \ - -e REPO_FILE_URL="$REPO_FILE_URL" \ - -e JENKINS_URL="$JENKINS_URL" \ - -e TARGET="$TARGET" \ - mock-build bash -c "$script" + "$DOCKER" run --name mock-build-"$unique"-${{ matrix.distro }} \ + "${docker_args[@]}" \ + -v "$PWD":"$PWD" -w "$PWD" \ + -v "$PWD"/mock_result/${CHROOT_NAME}:/var/lib/mock/$CHROOT_NAME/result \ + -v /scratch:/scratch \ + --privileged=true \ + -e DAOS_FULLNAME="$DAOS_FULLNAME" \ + -e DAOS_EMAIL="$DAOS_EMAIL" \ + -e DISTRO_VERSION="$DISTRO_VERSION" \ + -e STAGE_NAME="$STAGE_NAME" \ + -e CHROOT_NAME="$CHROOT_NAME" \ + -e ARTIFACTORY_URL="$ARTIFACTORY_URL" \ + -e REPO_FILE_URL="$REPO_FILE_URL" \ + -e JENKINS_URL="$JENKINS_URL" \ + -e TARGET="$TARGET" \ + mock-build bash -c "$script" ls -l mock_result/${CHROOT_NAME} # yamllint enable rule:line-length - name: Build RPM failure log