Merge branch 'development' of ssh://git.fifthgrid.com:3022/blockstorage/repertory into development

This commit is contained in:
2024-01-29 11:18:24 -06:00
15 changed files with 267797 additions and 0 deletions

79
scripts/make_common.sh Executable file
View File

@ -0,0 +1,79 @@
#!/bin/bash
BUILD_TYPE=$1
BUILD_CLEAN=$2
IS_MINGW=$3
if [ "${BUILD_TYPE}" == "" ]; then
BUILD_TYPE=Release
fi
if [ "${IS_MINGW}" == "1" ]; then
BUILD_ROOT=build2
else
BUILD_ROOT=build
fi
BUILD_FOLDER=$(echo "${BUILD_TYPE}" | tr '[:upper:]' '[:lower:]')
if [ "${BUILD_FOLDER}" == "release" ]; then
BUILD_TYPE=Release
fi
NUM_JOBS=${MY_NUM_JOBS}
if [[ -z "${NUM_JOBS}" ]]; then
NUM_JOBS=$(getconf _NPROCESSORS_ONLN 2> /dev/null || getconf NPROCESSORS_ONLN 2> /dev/null || echo 1)
if [ "${NUM_JOBS}" -gt "2" ]; then
NUM_JOBS=$(expr ${NUM_JOBS} - 2)
elif [ "${NUM_JOBS}" -gt "1" ]; then
NUM_JOBS=$(expr ${NUM_JOBS} - 1)
fi
fi
echo "Job count: ${NUM_JOBS}"
pushd "$(dirname "$0")"
mkdir -p ../${BUILD_ROOT}/${BUILD_FOLDER}
pushd ../${BUILD_ROOT}/${BUILD_FOLDER}
if [ "${IS_MINGW}" == "1" ]; then
TOOLCHAIN=$(realpath /cmake_toolchain.cmake)
CMAKE_ADDITIONAL_OPTS=-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
fi
if [ "${IS_MINGW}" == "1" ]; then
EXE_EXT=.exe
fi
cmake ../.. ${CMAKE_ADDITIONAL_OPTS} \
-G"Unix Makefiles" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DREPERTORY_ENABLE_S3=ON \
-DREPERTORY_ENABLE_S3_TESTING=ON || exit 1
pushd ..
ln -sf ${BUILD_FOLDER}/compile_commands.json .
ln -sf ${BUILD_FOLDER}/repertory${EXE_EXT} .
ln -sf ${BUILD_FOLDER}/unittests${EXE_EXT} .
if [ "${IS_MINGW}" == "1" ]; then
ln -sf ${BUILD_FOLDER}/winfsp-x64.dll .
fi
popd
if [ "${BUILD_CLEAN}" == "clean" ]; then
make clean
fi
make -j${NUM_JOBS} || exit 1
popd
pushd ../${BUILD_ROOT}
ln -sf ${BUILD_FOLDER}/compile_commands.json .
ln -sf ${BUILD_FOLDER}/repertory${EXE_EXT} .
ln -sf ${BUILD_FOLDER}/unittests${EXE_EXT} .
if [ "${IS_MINGW}" == "1" ]; then
ln -sf ${BUILD_FOLDER}/winfsp-x64.dll .
fi
popd
ln -sf ../3rd_party/cacert.pem ../${BUILD_ROOT}/cacert.pem
popd

28
scripts/make_win32.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
#
NUM_JOBS=${MY_NUM_JOBS}
if [[ -z "${NUM_JOBS}" ]]; then
NUM_JOBS=$(getconf _NPROCESSORS_ONLN 2> /dev/null || getconf NPROCESSORS_ONLN 2> /dev/null || echo 1)
if [ "${NUM_JOBS}" -gt "2" ]; then
NUM_JOBS=$(expr ${NUM_JOBS} - 2)
elif [ "${NUM_JOBS}" -gt "1" ]; then
NUM_JOBS=$(expr ${NUM_JOBS} - 1)
fi
fi
BUILD_TYPE=$1
BUILD_CLEAN=$2
SOURCE_DIR=$(dirname "$0")/..
SOURCE_DIR=$(realpath ${SOURCE_DIR})
NAME=mingw64
BUILD_ARCH=64_bit
docker stop repertory_${NAME}
docker rm repertory_${NAME}
docker build --build-arg NUM_JOBS=${MY_NUM_JOBS} -t repertory:${NAME} - < ${SOURCE_DIR}/docker/${BUILD_ARCH}/${NAME} &&
docker run -td -u $(id -u):$(id -g) --name repertory_${NAME} -w ${SOURCE_DIR} -v ${SOURCE_DIR}:${SOURCE_DIR}:rw,z repertory:${NAME} &&
docker exec repertory_${NAME} /bin/bash -c "${SOURCE_DIR}/scripts/make_common.sh ${BUILD_TYPE} \"${BUILD_CLEAN}\" 1"
docker stop repertory_${NAME}
docker rm repertory_${NAME}