2018-06-06 20:02:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2018-08-21 21:42:03 +00:00
|
|
|
if [ -d lib/"rice-box.go" ]; then
|
|
|
|
rm -rf lib/rice-box.go
|
2018-08-06 04:15:57 +00:00
|
|
|
fi
|
|
|
|
|
2018-06-06 20:02:00 +00:00
|
|
|
if [ "$USE_DOCKER" != "" ]; then
|
|
|
|
if [ -d "frontend/dist" ]; then
|
|
|
|
rm -rf frontend/dist
|
|
|
|
fi;
|
2018-04-18 15:27:28 +00:00
|
|
|
|
2018-08-20 09:41:06 +00:00
|
|
|
if [ "$(command -v git)" != "" ]; then
|
|
|
|
COMMIT_SHA="$(git rev-parse HEAD | cut -c1-8)"
|
|
|
|
else
|
|
|
|
COMMIT_SHA="untracked"
|
|
|
|
fi
|
|
|
|
|
2018-06-06 20:02:00 +00:00
|
|
|
$(command -v winpty) docker run -it \
|
|
|
|
--name filebrowser-tmp \
|
|
|
|
-v /$(pwd):/src:z \
|
2018-12-25 23:48:43 +00:00
|
|
|
-w //src \
|
2018-08-20 09:41:06 +00:00
|
|
|
-e COMMIT_SHA=$COMMIT_SHA \
|
2018-06-06 20:02:00 +00:00
|
|
|
filebrowser/dev \
|
|
|
|
sh -c "\
|
|
|
|
cd build && \
|
|
|
|
./build_assets.sh && \
|
|
|
|
./build.sh \
|
|
|
|
"
|
|
|
|
exitcode=$?
|
|
|
|
|
|
|
|
if [ $exitcode -eq 0 ]; then
|
|
|
|
for d in "dist/" "node_modules/"; do
|
2018-12-25 23:48:43 +00:00
|
|
|
docker cp filebrowser-tmp://src/frontend/$d frontend
|
2018-06-06 20:02:00 +00:00
|
|
|
done
|
2018-12-25 23:48:43 +00:00
|
|
|
docker cp filebrowser-tmp://src/cli/filebrowser ./filebrowser
|
|
|
|
docker cp filebrowser-tmp://src/lib/rice-box.go ./lib/rice-box.go
|
|
|
|
else
|
|
|
|
echo "BUILD FAILED!"
|
2018-06-06 20:02:00 +00:00
|
|
|
fi
|
|
|
|
docker rm -f filebrowser-tmp
|
|
|
|
else
|
2018-08-20 09:41:06 +00:00
|
|
|
set -e
|
2018-06-06 20:02:00 +00:00
|
|
|
./build/build_assets.sh
|
|
|
|
./build/build.sh
|
|
|
|
fi
|