Commit 3d7aa2bd authored by Emanuel Calvo's avatar Emanuel Calvo Committed by Matteo Melli
Browse files

Pushed scirp scheleton

parent 7c83f328
#!/bin/bash
[[ $# -lt 1 ]] && { echo "Specify the environment"; exit 1 ; }
ENVIRONMENT=$1
source .env_${ENVIRONMENT} # That is, .env_staging or .env_production
source utilities
source steps_${ENVIRONMENT}
# Failover steps go here
#
function 00_test(){
echo "Running things inside"
return $1
}
# Test
do_step 00_test 0 # force OK
do_step 00_test 1 # Force failing
echo "menu"
do_menu
#!/bin/bash
options=(00_step 01_step)
function 00_step(){
echo "Running things inside"
return $1
}
function 01_step(){
echo "Running things inside"
return $1
}
#!/bin/bash
function do_step(){
echo "Executing: $@"
"$@" || { echo "Step `$@` Failed." ; exit 2 ; } \
&& echo "Step `$@` ran OK"
}
function do_menu(){
echo "echo $options"
while read opt
do
echo $opt
done < <(echo $options)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment