From 908360eb1cdb5de40b48c500fa5161b37074ffa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 13 Feb 2018 11:46:08 +0100 Subject: [PATCH] Scripts for easier deployment without leaving ./deploy/ You can choose between build-quick.sh (which only does 4_run/build.sh) and build-all.sh (which does a full Docker image rebuild). --- deploy/build-all.sh | 1 + deploy/build-quick.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 120000 deploy/build-all.sh create mode 100755 deploy/build-quick.sh diff --git a/deploy/build-all.sh b/deploy/build-all.sh new file mode 120000 index 0000000..681ade2 --- /dev/null +++ b/deploy/build-all.sh @@ -0,0 +1 @@ +build-quick.sh \ No newline at end of file diff --git a/deploy/build-quick.sh b/deploy/build-quick.sh new file mode 100755 index 0000000..9d81dd4 --- /dev/null +++ b/deploy/build-quick.sh @@ -0,0 +1,34 @@ +#!/bin/bash -e + +# macOS does not support readlink -f, so we use greadlink instead +if [[ `uname` == 'Darwin' ]]; then + command -v greadlink 2>/dev/null 2>&1 || { echo >&2 "Install greadlink using brew."; exit 1; } + readlink='greadlink' +else + readlink='readlink' +fi +ROOT="$(dirname "$(dirname "$($readlink -f "$0")")")" +DOCKERDIR="$ROOT/docker/4_run" + +case "$(basename "$0")" in + build-quick.sh) + pushd "$ROOT/docker/4_run" + ./build.sh + ;; + build-all.sh) + pushd "$ROOT/docker" + ./full_rebuild.sh + ;; + *) + echo "Unknown script $0, aborting" >&2 + exit 1 +esac + +popd +echo +echo "Press [ENTER] to push the new Docker image." +read dummy +docker push armadillica/blender_cloud:latest +echo +echo "Build is done, ready to update the server." +