Commit 856d2315 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

chore: remove check_for_update script

parent c6a41267
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -396,11 +396,6 @@ stages:
    echo -e "environment_type=$ENV_TYPE\\nenvironment_url=$environment_url" > ansible.env
  }

  function get_latest_template_version() {
    tag_json=$(ansible localhost -m uri -a "url=$CI_API_V4_URL/projects/to-be-continuous%2F$1/repository/tags?per_page=1 return_content=yes" 2>/dev/null |grep \"content\" |sed -rn 's/^\s*"content": "(.*)",\s*$/\1/p' || echo "")
    echo "$tag_json" | sed -rn 's/^.*"name.?":.?"([^"\]*).?".*$/\1/p'
  }

  function cleanup_secrets() {
     if [ -f ".ansible_private_key" ]; then
       rm -rf .ansible_private_key
@@ -413,20 +408,6 @@ stages:
     fi
  }

  function check_for_update() {
    template="$1"
    actual="$2"
    latest=$(get_latest_template_version "$template")
    if [[ -n "$latest" ]] && [[ "$latest" != "$actual" ]]
    then
      log_warn "\\e[1;93m=======================================================================================================\\e[0m"
      log_warn "\\e[93mThe template \\e[32m$template\\e[93m:\\e[33m$actual\\e[93m you're using is not up-to-date: consider upgrading to version \\e[32m$latest\\e[0m"
      log_warn "\\e[93m(set \$TEMPLATE_CHECK_UPDATE_DISABLED to disable this message)\\e[0m"
      log_warn "\\e[1;93m=======================================================================================================\\e[0m"
    fi
  }

  if [[ "$TEMPLATE_CHECK_UPDATE_DISABLED" != "true" ]]; then check_for_update ansible "2.1.4"; fi
  unscope_variables
  eval_all_secrets