From 1c0df87f786f7a527a60fe5bda752712baaf8b4d Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 18 Aug 2020 17:12:58 -0400 Subject: [PATCH] add build script --- bin/build.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 bin/build.sh diff --git a/bin/build.sh b/bin/build.sh new file mode 100755 index 00000000..5df6721a --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +### Bash Environment Setup +# http://redsymbol.net/articles/unofficial-bash-strict-mode/ +# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html +# set -o xtrace +set -o errexit +set -o errtrace +set -o nounset +set -o pipefail +IFS=$'\n' + +REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )" + +source "$REPO_DIR/.venv/bin/activate" +cd "$REPO_DIR" + +# echo "[*] Fetching latest docs version" +# cd "$REPO_DIR/docs" +# git pull +# cd "$REPO_DIR" + +# echo "[+] Building docs" +# sphinx-apidoc -o docs archivebox +# cd "$REPO_DIR/docs" +# make html +# cd "$REPO_DIR" + +echo "[*] Cleaning up build dirs" +cd "$REPO_DIR" +rm -Rf build dist archivebox.egg-info + +echo "[+] Building sdist, bdist_egg, and bdist_wheel" +python3 setup.py sdist bdist_egg bdist_wheel + +echo "[+] Building docker image in the background..." +docker build . -t archivebox \ + -t archivebox:latest > /tmp/archivebox_docker_build.log 2>&1 & +ps "$!" + +echo "[√] Done. Install the built package by running:" +echo " python3 setup.py install" +echo " # or" +echo " pip3 install ."