aboutsummaryrefslogtreecommitdiffhomepage
path: root/files/clever-set-scalability.sh
blob: 34a5a24930be0b8d12f79e5b53f9caf2f86282ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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[@]}"