Skip to content
Permalink
836913c051
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 63 lines (48 sloc) 1.43 KB
#!/bin/bash
set -e
set -u
BUILD_LOCAL=build.local
if [ ! -e ${BUILD_LOCAL} ]; then
echo "# Warning: build.local not found. creating defaults:"
install -m 755 <( cat <<_EOP_
PROJECT=${HOME}/photoprism/\${BUILD_TAG}
PREFIX=${HOME}/photoprism/\${BUILD_TAG}
TMPDIR=${TMPDIR:-/tmp}/photoprism/${USER}/\${BUILD_TAG}
_EOP_
) ${BUILD_LOCAL}
cat ${BUILD_LOCAL}
echo "# check / edit build.local"
ls -l build.local
exit
fi
. build.profile
mkdir -vp "${PREFIX}"
mkdir -vp --mode=700 "${TMPDIR}"
mkdir -vp --mode=700 "${XDG_CACHE_HOME:=${TMPDIR}.cache}"
mkdir -vp --mode=700 "${DEVSHM}"
mkdir -vp "${BUILD_DIR}"
# logging
LOGS="${BUILD_DIR}"/logs
mkdir -vp "${LOGS}"
pushd "${LOGS}"
cnt=1
logfile=build-"$(date +%Y-%m-%d)".$cnt.log
set -o noclobber
# shellcheck disable=SC2188
while ! { > "${logfile}" ; } &> /dev/null; do
cnt=$((cnt + 1))
printf -v logfile "%s.%s.log" "build-$(date +%Y-%m-%d)" ${cnt}
done
set +o noclobber
set -x
ln -fs "${logfile}" "build.log"
popd
{
[ -d "${BUILD_DIR}/${BUILD_sqlite}" ] || ./sqlite.build.sh
[ -d "${BUILD_DIR}/${BUILD_python}" ] || ./Python.build.sh
[ -d "${BUILD_DIR}/${BUILD_node}" ] || ./node.build.sh
[ -d "${BUILD_DIR}/${BUILD_openjpeg}" ] || ./openjpeg.build.sh
[ -d "${BUILD_DIR}/${BUILD_libwebp}" ] || ./libwebp.build.sh
[ -d "${BUILD_DIR}/${BUILD_libvips}" ] || ./libvips.build.sh
[ -d "$PROJECT/${BUILD_photoprism}" ] || ./photoprism.build.sh
} 2>&1 | tee "${LOGS}/${logfile}" 2>&1