filebrowser/build/build_all.sh
1138-4EB 40b0cd4b66 add travis
Former-commit-id: a68e501a962cdd7c3a9e5a3d91433cbec34265e3 [formerly ab4763c975794e5997fab6abb51b2e91bda6e08a] [formerly 709e134df8986005308f3e125348fe13cf92919a [formerly 703318c214]]
Former-commit-id: 6672ab0918f84d73819f038cc5a24f1ce22625b4 [formerly 21d926cefe6d46ec2a99eba5e589b264e818d22d]
Former-commit-id: 294b3fa3faae6363f483388ccbedcf091d1f837c
2018-08-06 05:01:16 +01:00

39 lines
869 B
Bash
Executable File

#!/bin/sh
cd $(dirname $0)/..
if [ "$USE_DOCKER" != "" ]; then
if [ -d "frontend/dist" ]; then
rm -rf frontend/dist
fi;
WORKDIR="/go/src/github.com/filebrowser/filebrowser"
$(command -v winpty) docker run -it \
--name filebrowser-tmp \
-v /$(pwd):/src:z \
-w /${WORKDIR} \
filebrowser/dev \
sh -c "\
cp -r //src/* /$WORKDIR && \
cd build && \
dos2unix build_assets.sh && \
dos2unix build.sh && \
./build_assets.sh && \
./build.sh \
"
exitcode=$?
if [ $exitcode -eq 0 ]; then
for d in "dist/" "node_modules/"; do
docker cp filebrowser-tmp:/$WORKDIR/frontend/$d frontend
done
for d in "vendor/" "rice-box.go" "filebrowser"; do
docker cp filebrowser-tmp:/$WORKDIR/$d ./
done
fi
docker rm -f filebrowser-tmp
else
./build/build_assets.sh
./build/build.sh
fi