Only copy packages, if packages are build

This commit is contained in:
LordGrey 2021-06-14 20:48:48 +02:00 committed by GitHub
parent a9fb5fa359
commit 6d004240de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,22 +156,26 @@ $DOCKER run --rm \
${REGISTRY_URL}/${BUILD_IMAGE}:${BUILD_TAG} \ ${REGISTRY_URL}/${BUILD_IMAGE}:${BUILD_TAG} \
/bin/bash -c "mkdir -p /source/${BUILD_DIR} && cd /source/${BUILD_DIR} && /bin/bash -c "mkdir -p /source/${BUILD_DIR} && cd /source/${BUILD_DIR} &&
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&
make -j $(nproc) ${PACKAGES} || exit 3 && make -j $(nproc) ${PACKAGES} || exit 3 || : &&
echo '---> Copying packages to host folder: ${DEPLOY_PATH}' &&
cp -v /source/${BUILD_DIR}/Hyperion-* /deploy 2>/dev/null || : &&
exit 0; exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 4; } exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 4; }
DOCKERRC=${?}
# overwrite file owner to current user # overwrite file owner to current user
sudo chown -fR $(stat -c "%U:%G" ${BASE_PATH}) ${BUILD_PATH} sudo chown -fR $(stat -c "%U:%G" ${BASE_PATH}) ${BUILD_PATH}
sudo chown -fR $(stat -c "%U:%G" ${BASE_PATH}) ${DEPLOY_PATH} sudo chown -fR $(stat -c "%U:%G" ${BASE_PATH}) ${DEPLOY_PATH}
if [ ${DOCKERRC} == 0 ]; then
if [ ${BUILD_LOCAL} == 1 ]; then if [ ${BUILD_LOCAL} == 1 ]; then
echo "---> Find compiled binaries in: ${BUILD_PATH}/bin" echo "---> Find compiled binaries in: ${BUILD_PATH}/bin"
fi fi
if [ ${BUILD_PACKAGES} == "true" ]; then if [ ${BUILD_PACKAGES} == "true" ]; then
echo "---> Copying packages to host folder: ${DEPLOY_PATH}" &&
cp -v ${BUILD_PATH}/Hyperion-* ${DEPLOY_PATH} 2>/dev/null
echo "---> Find deployment packages in: ${DEPLOY_PATH}" echo "---> Find deployment packages in: ${DEPLOY_PATH}"
fi fi
echo "---> Script finished" fi
exit 0 echo "---> Script finished [${DOCKERRC}]"
exit ${DOCKERRC}