From 433fdfa91fc7e4e5ccdd44574c83c45885c071a7 Mon Sep 17 00:00:00 2001 From: Carlos Mogas da Silva Date: Sun, 8 Dec 2024 01:38:11 +0000 Subject: [PATCH] Create a common directory for artifacts This way they can all be uploaded by an artifact-upload step --- entrypoint.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0b6636d..550cae6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,6 +14,8 @@ rm -rf /var/lib/mock/* mount -t tmpfs tmpfs /var/lib/mock RESULT="rpms=[" +OUTPUTDIR=$(pwd)/artifacts +mkdir ${OUTPUTDIR} for SPEC in ${SPECS[@]}; do SPEC_NAME=$(basename ${SPEC}) @@ -34,28 +36,30 @@ for SPEC in ${SPECS[@]}; do exit 1 fi - mock -r "${SYSTEM}-${ARCH}" --buildsrpm --spec ${SPEC_NAME} --sources . --resultdir result + PKG_OUTPUTDIR=${OUTPUTDIR}/$(dirname ${SPEC}) + + mock -r "${SYSTEM}-${ARCH}" --buildsrpm --spec ${SPEC_NAME} --sources . --resultdir ${PKG_OUTPUTDIR} if [ $? -ne 0 ]; then echo "::error::Failed to build SRPM" exit 1 fi echo "::endgroup::" - SRPM=$(grep Wrote result/build.log | cut -d ":" -f 2 | tr -d " " | xargs basename) + SRPM=$(grep Wrote ${PKG_OUTPUTDIR}/build.log | cut -d ":" -f 2 | tr -d " " | xargs basename) echo "::group::Building RPM" OPTS="" if [ ${NOCHECK,,} == "true" ]; then OPTS="${OPTS} --nocheck" fi - mock -r "${SYSTEM}-${ARCH}" --resultdir result ${OPTS} result/${SRPM} + mock -r "${SYSTEM}-${ARCH}" --resultdir ${PKG_OUTPUTDIR} ${OPTS} ${PKG_OUTPUTDIR}/${SRPM} if [ $? -ne 0 ]; then echo "::error::Failed to build RPM" exit 1 fi echo "::endgroup::" - RPMS=$(grep Wrote result/build.log | grep "/RPMS/" | cut -d" " -f 2 | xargs basename) + RPMS=$(grep Wrote ${PKG_OUTPUTDIR}/build.log | grep "/RPMS/" | cut -d" " -f 2 | xargs basename) echo "::debug::built rpm: ${RPMS}" RESULT="${RESULT},\"${RPMS}\"" cd - &> /dev/null