Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
## v2.0.2-rc ### BREAKING CHANGES * Refactored `config.json` - will need to verify configuration settings prior to mounting ### Issues * \#12 \[Unit Test\] Complete all providers unit tests * \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup * \#16 Add support for bucket name in Sia provider * \#17 Update to common c++ build system * A single 64-bit Linux Jenkins server is used to build all Linux and Windows versions * All dependency sources are now included * MSVC is no longer supported * MSYS2 is required for building Windows binaries on Windows * OS X support is temporarily disabled * \#19 \[bug\] Rename file is broken for files that are existing * \#23 \[bug\] Incorrect file size displayed while upload is pending * \#24 RocksDB implementations should be transactional * \#25 Writes should block when maximum cache size is reached * \#26 Complete ring buffer and direct download support ### Changes from v2.0.1-rc * Ability to choose between RocksDB and SQLite databases * Added direct reads and implemented download fallback * Corrected file times on S3 and Sia providers * Corrected handling of `chown()` and `chmod()` * Fixed erroneous download of chunks after resize Reviewed-on: #27
67 lines
2.2 KiB
Bash
Executable File
67 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
TEMP_DIR=$(mktemp -d)
|
|
|
|
PROJECT_SCRIPTS_DIR=$(realpath "$0")
|
|
PROJECT_SCRIPTS_DIR=$(dirname "${PROJECT_SCRIPTS_DIR}")
|
|
. "${PROJECT_SCRIPTS_DIR}/env.sh" "$1" "$2" "$3" "$4" "$5"
|
|
|
|
function error_exit() {
|
|
echo $1
|
|
rm -rf ${TEMP_DIR}
|
|
exit $2
|
|
}
|
|
|
|
function create_file_validations() {
|
|
local SOURCE_FILE=$1
|
|
sha256sum ${SOURCE_FILE} >${SOURCE_FILE}.sha256 || error_exit "failed to create sha256 for file: ${SOURCE_FILE}" 1
|
|
if [ "${PROJECT_PRIVATE_KEY}" != "" ]; then
|
|
openssl dgst -sha256 -sign "${PROJECT_PRIVATE_KEY}" -out "${SOURCE_FILE}.sig" "${SOURCE_FILE}" || error_exit "failed to create signature for file: ${SOURCE_FILE}" 1
|
|
openssl dgst -sha256 -verify "${PROJECT_PUBLIC_KEY}" -signature "${SOURCE_FILE}.sig" "${SOURCE_FILE}" || error_exit "failed to validate signature for file: ${SOURCE_FILE}" 1
|
|
fi
|
|
}
|
|
|
|
if [ ! -d "${PROJECT_DIST_DIR}" ]; then
|
|
error_exit "dist directory not found: ${PROJECT_DIST_DIR}" 2
|
|
fi
|
|
|
|
pushd "${PROJECT_DIST_DIR}"
|
|
if [ -f "${PROJECT_OUT_FILE}" ]; then
|
|
rm -f "${PROJECT_OUT_FILE}" || error_exit "failed to delete file: ${PROJECT_OUT_FILE}" 1
|
|
fi
|
|
if [ -f "${PROJECT_OUT_FILE}.sha256" ]; then
|
|
rm -f "${PROJECT_OUT_FILE}.sha256" || error_exit "failed to delete file: ${PROJECT_OUT_FILE}.sha256" 1
|
|
fi
|
|
if [ -f "${PROJECT_OUT_FILE}.sig" ]; then
|
|
rm -f "${PROJECT_OUT_FILE}.sig" || error_exit "failed to delete file: ${PROJECT_OUT_FILE}.sig" 1
|
|
fi
|
|
popd
|
|
|
|
rsync -av --progress ${PROJECT_DIST_DIR}/ ${TEMP_DIR}/${PROJECT_NAME}/ || error_exit "failed to rsync" 1
|
|
|
|
for APP in ${PROJECT_APP_LIST[@]}; do
|
|
if [ "${PROJECT_BUILD_SHARED_LIBS}" == "ON" ] && [ "${PROJECT_IS_MINGW}" != "1" ]; then
|
|
strip ${TEMP_DIR}/${PROJECT_NAME}/bin/${APP}${PROJECT_APP_BINARY_EXT}
|
|
else
|
|
strip ${TEMP_DIR}/${PROJECT_NAME}/${APP}${PROJECT_APP_BINARY_EXT}
|
|
fi
|
|
done
|
|
|
|
pushd "${TEMP_DIR}/${PROJECT_NAME}/"
|
|
IFS=$'\n'
|
|
set -f
|
|
FILE_LIST=$(find . -type f)
|
|
for FILE in ${FILE_LIST}; do
|
|
create_file_validations "${FILE}"
|
|
done
|
|
unset IFS
|
|
set +f
|
|
popd
|
|
|
|
pushd "${PROJECT_DIST_DIR}"
|
|
tar cvzf "${PROJECT_OUT_FILE}" -C ${TEMP_DIR} . || error_exit "failed to create archive: ${PROJECT_OUT_FILE}" 1
|
|
create_file_validations "${PROJECT_OUT_FILE}"
|
|
popd
|
|
|
|
error_exit "created package ${PROJECT_FILE_PART}" 0
|