Commit 7d57ffeb authored by Matteo Melli's avatar Matteo Melli
Browse files

Created steps_production

parent 963dccb4
......@@ -14,11 +14,6 @@ function 00_test(){
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)
export steps=(000_step 001_step)
function 00_step(){
function 000_step(){
echo "Running things inside"
return $1
}
function 01_step(){
function 001_step(){
echo "Running things inside"
return $1
}
......
......@@ -3,32 +3,21 @@
function do_step(){
echo "Executing: $@"
"$@" || { echo "Step `$@` Failed." ; exit 2 ; } \
&& echo "Step `$@` ran OK"
&& echo "Step `$@` ran OK"
}
function do_menu(){
IF=''
select step in $(print_steps)
select step in "${steps[@]}"
do
script="$(echo "$step"|cut -d ' ' -f 1)"
echo -n "Press a key to execute $script"
read
do_step "$script"
echo "Step $step will be executed:"
echo
type "$step" | head -n -1 | tail -n +4
echo
read -s -N 1 -p "Press [y] to continue, any other key to abort." key
if [ "$key" == "y" ]
then
do_step "$step"
fi
done
}
function print_steps(){
echo "001_check_gcp_replication_delay Ensure the prospective failover target in GCP is up to date"
echo "002_disable-automatic-failover Disable chef on all nodes and shut down repmgr"
#This step should convert old master to headless standby
echo "003_forbid-writes-to-current-master Forbid writes to the currect master (Azure) – do not allow any connections except replication and administrative (local via socket) ones."
echo "004_perform-regular-switchover Perform regular switchover to the main replica on GCP"
echo "005_check_gcp_has_master Check the database is now read-write"
echo "006_configure-pgbouncer-for-gcp Configure pgbouncer to point to new master in GCP"
echo "007_convert-wal-e-node-to-standby Convert the WAL-E node to a standby node in repmgr"
echo "008_ensure-priority-is-updated-in-repmgr Ensure priority is updated in repmgr configuration"
echo "009_update_chef_cookbook Update in chef cookbooks by removing the setting entirely"
echo "010_update_master_repmgr_priority Update in the running database (On the primary server)"
echo "011_reduce_statement_timeout Reduce statement_timeout to 15s"
}
\ No newline at end of file
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