#!/bin/bash set -eu [[ $# -lt 2 ]] && { echo "Specify the environment and role"; exit 1 ; } # Because some of the script use one or another, we clone both, # although we need to homogenize export BASE="$(dirname "$0")" export ENVIRONMENT=$1 export ROLE=$2 export GITLAB_ENV=$ENVIRONMENT # shellcheck source=/dev/null source "${BASE}/source_vars" source "${BASE}/env_${ENVIRONMENT}" # That is, .env_staging or .env_production (test also supported) source "${BASE}/migration_utilities" source "${BASE}/steps_${ROLE}" #Check all steps have a script for step in "${steps[@]}" do if ! step_check "$step" then >&2 echo "Function $(step_script "$step") do not exists for step $(step_3digit_number "$step")" exit 1 fi done do_menu