Commit 7fa82c21 authored by Matteo Melli's avatar Matteo Melli

Shellcheck

parent 1a52a157
Pipeline #88779 passed with stage
in 16 seconds
......@@ -5,18 +5,23 @@ set -eu
# shellcheck source=/dev/null
source "${BASE}/env_${ENVIRONMENT}"
# shellcheck disable=SC2030,SC2031,SC2036,SC2116
azure_master_lsn="$(echo "select case when pg_is_in_recovery()
then pg_last_xlog_replay_location()
else pg_current_xlog_location() end;")" \
| ssh_remote "$AZURE_MASTER" sudo -u gitlab-psql gitlab-psql -d postgres -t -A
# shellcheck disable=SC2030,SC2031,SC2036,SC2116
gcp_master_candidate_lsn="$(echo "select case when pg_is_in_recovery()
then pg_last_xlog_replay_location()
else pg_current_xlog_location() end;" \
| ssh_remote "$GCP_MASTER_CANDIDATE" sudo -u gitlab-psql gitlab-psql -d postgres -t -A)"
# shellcheck disable=SC2030,SC2031
if [ "$azure_master_lsn" == "$gcp_master_candidate_lsn" ]
then
# shellcheck disable=SC2030,SC2031
echo "GCP and Azure have same LSN: $azure_master_lsn"
exit 0
fi
# shellcheck disable=SC2030,SC2031
echo "GCP and Azure have NOT same LSN. Current LSNs are: Azure/$azure_master_lsn GCP/$gcp_master_candidate_lsn"
exit 1
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