From 96f02eb1f426c16c631598c80bec4bc0e60f75c1 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Fri, 19 Jun 2020 15:39:22 +0200 Subject: Add support for scalability configuration Closes #52 --- files/clever-set-scalability.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 files/clever-set-scalability.sh (limited to 'files') diff --git a/files/clever-set-scalability.sh b/files/clever-set-scalability.sh new file mode 100755 index 0000000..34a5a24 --- /dev/null +++ b/files/clever-set-scalability.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -eo pipefail +params=() +if [ -n "$INSTANCES" ]; then + params+=("--instances" "${INSTANCES}") +elif [ -n "$MIN_INSTANCES" ] && [ -n "$MAX_INSTANCES" ]; then + params+=("--min-instances" "${MIN_INSTANCES}") + params+=("--max-instances" "${MAX_INSTANCES}") + +fi +if [ -n "$FLAVOR" ]; then + params+=("--flavor" "${FLAVOR}") +elif [ -n "$MIN_FLAVOR" ] && [ -n "$MAX_FLAVOR" ]; then + params+=("--min-flavor" "${MIN_FLAVOR}") + params+=("--max-flavor" "${MAX_FLAVOR}") +fi + +clever scale "${params[@]}" -- cgit v1.2.3