Commit bd1ba856 authored by Cris Bris's avatar Cris Bris Committed by Pierre Smeyers
Browse files

fix(destroy): fix tf-destroy not deleting state

parent 8e6d7017
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1120,7 +1120,12 @@ stages:
      # shellcheck disable=SC2086
      apk add --no-cache ${TF_APK_EXTRA_OPTS:-$TBC_APK_EXTRA_OPTS} curl
      fi
      curl --header "Private-Token: ${TF_PASSWORD}" --request DELETE "${TF_ADDRESS}"
      if [[ "${TF_USERNAME}" == "gitlab-ci-token" ]]
      then
        curl -sSf --user "gitlab-ci-token:${CI_JOB_TOKEN}" --request DELETE "${TF_ADDRESS}" || log_warn "Failed deleting GitLab-managed TF state"
      else
        curl -sSf --header "Private-Token: ${TF_PASSWORD}" --request DELETE "${TF_ADDRESS}" || log_warn "Failed deleting GitLab-managed TF state"
      fi
    fi

    # maybe execute post destroy script