Create a common directory for artifacts
All checks were successful
Build docker image / build-and-publish (push) Successful in 5m28s
All checks were successful
Build docker image / build-and-publish (push) Successful in 5m28s
This way they can all be uploaded by an artifact-upload step
This commit is contained in:
parent
7f6c070dfd
commit
433fdfa91f
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue