mirror of
https://github.com/theotherp/nzbhydra2.git
synced 2026-02-06 11:17:18 +00:00
30 lines
1.1 KiB
Bash
30 lines
1.1 KiB
Bash
#!/bin/bash
|
|
set -e # Exit on any error
|
|
|
|
# Prepares and runs the docker container to build the core executable
|
|
|
|
if [[ ! -d "${PWD}/core" ]] ; then
|
|
echo "${PWD}/core not found - you must be in the project main folder"
|
|
exit 1
|
|
fi
|
|
|
|
echo Removing old amd64 executable
|
|
rm -f releases/linux-amd64-release/include/executables/core
|
|
|
|
echo Syncing with build directory
|
|
rsync -ru --delete --exclude "target" --exclude "bower_components" --exclude "node_modules" --exclude ".git" --exclude ".idea" --exclude "results" --exclude "*.db" --exclude "venv*" ${PWD}/ /home/user/nzbhydra2/
|
|
|
|
echo Running build script using docker
|
|
docker run -v /home/user/nzbhydra2/:/nzbhydra2:rw -v /home/user/.m2/repository:/home/user/.m2/repository:rw --rm hydrabuild:latest
|
|
|
|
if [[ ! -f /home/user/nzbhydra2/core/target/core ]] ; then
|
|
echo "ERROR: core executable does not exist after build"
|
|
exit 1
|
|
fi
|
|
|
|
echo Copying executable to target directories
|
|
cp /home/user/nzbhydra2/core/target/core ${PWD}/core/target/
|
|
cp /home/user/nzbhydra2/core/target/core ${PWD}/releases/linux-amd64-release/include/executables/
|
|
|
|
echo "amd64 build completed successfully"
|