From 82aeefc0ac88b3e704ffd908cf00bc425e368bd7 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 17 Dec 2019 15:54:15 +0100 Subject: [PATCH] new: [install.sh] allow a unique ``DEPLOY_REF`` env var to select version to install This concerns the charm-store, the compose binary and the compose docker image. By default, ``DEPLOY_REF`` will be ``lokavaluto/dev/master``. Signed-off-by: Valentin Lab --- src/install.sh | 63 +++++++++++++++----------------------------------- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/src/install.sh b/src/install.sh index 247109f..309d146 100644 --- a/src/install.sh +++ b/src/install.sh @@ -150,13 +150,15 @@ install_file() { get_charm_store() { + local branch="${1:master}" if ! [ -d "$CHARM_PATH" ]; then echo "Creating charm-store in '$CHARM_PATH'." - git clone https://git.0k.io/0k-charms.git "$CHARM_PATH" || exit 1 + git clone https://git.0k.io/0k-charms.git -b "$branch" "$CHARM_PATH" || exit 1 else echo "Updating existing charm-store in '$CHARM_PATH'." cd "$CHARM_PATH" || exit 1 - git checkout master && + git fetch && + git checkout "$branch" && git pull -r || { warn "Could not update charm-store, do you have devs ingoing ?" } @@ -210,7 +212,7 @@ install.linux() { COMPOSE_OPTION_FILE=/etc/compose/local.conf fi - fetch_binary https://git.0k.io/0k-compose.git/plain/bin/compose compose + fetch_binary https://git.0k.io/0k-compose.git/plain/bin/compose?h="${DEPLOY_REF}" compose get_docker_ip if [[ ":$PATH:" != *":$BIN_PATH:"* ]]; then @@ -218,54 +220,22 @@ install.linux() { "the simple usage of 'compose' command." fi - ## CHARMS - get_charm_store || exit 1 + get_charm_store "${DEPLOY_REF}" || exit 1 - ## - ## YYYvlab: following needs to be discussed further with njeudy - ## + cat <