2021-07-16 08:09:27 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-12-28 15:39:00 -05:00
|
|
|
RELEASE=2.3
|
2021-07-16 08:09:27 -04:00
|
|
|
|
|
|
|
build () {
|
|
|
|
echo "Building cavepedia/cavepedia:$RELEASE"
|
|
|
|
docker build -t cavepedia/cavepedia:$RELEASE ./src
|
|
|
|
}
|
|
|
|
|
|
|
|
import_data () {
|
|
|
|
echo "Importing cavepedia.bleve version $RELEASE"
|
|
|
|
if [ ! -f ./cavepedia-$RELEASE.zip ]; then
|
|
|
|
cp -r /bigdata/archive/cavepedia/release/cavepedia-$RELEASE.zip .
|
|
|
|
unzip cavepedia-$RELEASE.zip
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
up () {
|
|
|
|
build
|
|
|
|
import_data
|
|
|
|
|
2022-12-28 15:39:00 -05:00
|
|
|
docker network create --ipv6 pew-net || true
|
2021-07-16 08:09:27 -04:00
|
|
|
|
|
|
|
# Exposed on port 3000 on pew-net
|
|
|
|
docker run \
|
|
|
|
--detach \
|
|
|
|
--name cavepedia \
|
|
|
|
--restart unless-stopped \
|
2022-12-28 15:39:00 -05:00
|
|
|
--label com.centurylinklabs.watchtower.enable=false \
|
2021-07-16 08:09:27 -04:00
|
|
|
--env PROXY=1 \
|
|
|
|
--env-file cavepedia.env \
|
|
|
|
--volume $PWD/cavepedia-$RELEASE/cavepedia-data:/go/src/app/cavepedia-data:ro \
|
|
|
|
--volume $PWD/cavepedia-$RELEASE/cavepedia.bleve:/go/src/app/cavepedia.bleve:rw \
|
|
|
|
--network pew-net \
|
|
|
|
cavepedia/cavepedia:$RELEASE
|
|
|
|
}
|
|
|
|
|
|
|
|
down () {
|
|
|
|
docker stop cavepedia || true
|
|
|
|
docker rm cavepedia || true
|
|
|
|
}
|
|
|
|
|
|
|
|
logs () {
|
|
|
|
docker logs --follow cavepedia
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$@
|