010-fill-event-log-gaps.sh 706 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/env bash

set -euo pipefail
IFS=$'\n\t'

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UNSYMLINKED_SCRIPT_DIR="$(greadlink -f "${SCRIPT_DIR}" || readlink "${SCRIPT_DIR}" || echo "${SCRIPT_DIR}")"
# shellcheck disable=SC1091,SC1090
source "${UNSYMLINKED_SCRIPT_DIR}/../../../../workflow-script-commons.sh"

# --------------------------------------------------------------

if [[ ${FAILOVER_ENVIRONMENT} == "stg" ]]; then
  DEPLOY_HOST=deploy.stg.gitlab.com
elif [[ ${FAILOVER_ENVIRONMENT} == "prd" ]]; then
  DEPLOY_HOST=deploy.gitlab.com
fi

# remote_gitlab_runner will log the command internally
remote_gitlab_runner "${DEPLOY_HOST}" "${SCRIPT_DIR}/010-fill-event-log-gaps.rb"