repertory/scripts/deliver.sh
Scott E. Graves fa439c634f
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
v2.0.3-rc (#32)
# Changelog

## v2.0.3-rc

### Issues

* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
* \#29 \[bug\] S3 error responses are not being logged
* \#30 \[bug\] Sia provider error responses are not logged
* \#31 \[bug\] S3 provider should limit max key size to 1024

### Changes from v2.0.2-rc

* Always use direct for read-only providers
* Fixed externally removed files not being processed during cleanup
* Fixed http headers not being added for requests
* Fixed incorrect `stat` values for remote mounts
* Fixed invalid directory nullptr error on remote mounts
* Fixed memory leak in event system
* Refactored application shutdown
* Refactored event system
* Updated build system to Alpine 3.21.0
* Updated build system to MinGW-w64 12.0.0
* Updated copyright to 2018-2025

Reviewed-on: #32
2025-02-11 17:26:24 -06:00

70 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
DEST_DIR=$1
DIST_DIR=$2
PROJECT_SCRIPTS_DIR=$(realpath "$0")
PROJECT_SCRIPTS_DIR=$(dirname "${PROJECT_SCRIPTS_DIR}")
. "${PROJECT_SCRIPTS_DIR}/env.sh" "$3" "$4" "$5" "$6" "$7"
function error_exit() {
echo $1
exit $2
}
if [ ! -d "${PROJECT_DIST_DIR}" ]; then
error_exit "dist directory not found: ${PROJECT_DIST_DIR}" 2
fi
if [ "${DIST_DIR}" == "" ]; then
DIST_DIR="${PROJECT_DIST_DIR}"
fi
DIST_DIR=$(realpath "${DIST_DIR}")
if [ ! -d "${DIST_DIR}" ]; then
error_exit "dist directory not found: ${DIST_DIR}" 2
fi
if [ "${DEST_DIR}" == "" ]; then
error_exit "dest directory not set" 2
fi
if [ ! -d "${DEST_DIR}" ]; then
error_exit "dest directory not found: ${DEST_DIR}" 2
fi
pushd "${PROJECT_SOURCE_DIR}"
BRANCH=$(git branch --show-current)
RELEASE=$(grep PROJECT_RELEASE_ITER= ./config.sh | sed s/PROJECT_RELEASE_ITER=//g)
popd
if [ "${BRANCH}" == "master" ] || [ "${BRANCH}" == "alpha" ] || [ "${BRANCH}" == "beta" ] || [ "${BRANCH}" == "rc" ]; then
DEST_DIR=${DEST_DIR}/${RELEASE}
else
DEST_DIR=${DEST_DIR}/nightly
fi
echo ${DEST_DIR}
pushd "${DIST_DIR}"
if [ ! -f "./${PROJECT_OUT_FILE}" ]; then
error_exit "failed to find file: ${PROJECT_OUT_FILE}" 1
fi
if [ ! -f "./${PROJECT_OUT_FILE}.sha256" ]; then
error_exit "failed to find file: ${PROJECT_OUT_FILE}.sha256" 1
fi
if [ "${PROJECT_PRIVATE_KEY}" != "" ] && [ ! -f "./${PROJECT_OUT_FILE}.sig" ]; then
error_exit "failed to find file: ${PROJECT_OUT_FILE}.sig" 1
fi
cp -f ./${PROJECT_OUT_FILE} ${DEST_DIR} || error_exit "failed to deliver file: ${PROJECT_OUT_FILE}" 1
cp -f ./${PROJECT_OUT_FILE}.sha256 ${DEST_DIR} || error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sha256" 1
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
cp -f ./${PROJECT_OUT_FILE}.sig ${DEST_DIR} || error_exit "failed to deliver file: ${PROJECT_OUT_FILE}.sig" 1
fi
popd
error_exit "delivered ${PROJECT_FILE_PART}" 0