#!/bin/bash

set -e

if [[ -n "${STACTOOLS_DEBUG}" ]]; then
    set -x
fi

source $(dirname "$0")/env

function usage() {
    echo -n \
        "Usage: $(basename "$0")
Build and serve documentation from a docker container with all prerequisites installed.
"
}

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
    docker run --rm -it \
        -p 8000:8000 \
        -v `pwd`:/opt/stactools \
        -w /opt/stactools/docs \
        --entrypoint /bin/bash \
        $DOCKER_REGISTRY/$DOCKER_ORG/$DOCKER_REPO:$DOCKER_TAG_DEV \
        -c "make livehtml"
fi
