Skip to content

Commit

Permalink
Added upgrade guard (and override mechanism)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisjbell committed Dec 19, 2022
1 parent edb08ca commit 8231a32
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions ci/tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ params:
BOSH_CLIENT_SECRET: ((bosh.password))
KEEP_STATE: true
SECRETS_SEED_DATA: ((secrets_seed_data))
FORCE_INCOMPATIBLE_UPGRADE: yes
20 changes: 19 additions & 1 deletion hooks/check
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ue

#Version check
version_check 2.8.5 || exit 1 # TODO: Update to 2.8.6 when released
version_check 2.8.6 || exit 1

# Cloud Config checks
ok=yes
Expand Down Expand Up @@ -45,6 +45,24 @@ if want_feature vsphere; then
done
fi

version="$(exodus kit_version)"
if [[ -n "${version:-}" ]] ; then
set +e
if ! new_enough "$version" "3.0.0" ; then
describe >&2 "" " #C{[Checking Upgrade from $version]}"

if ! new_enough "${version}" "2.2.7-rc.0" ; then
describe >&2 " #R{[ERROR]} Please upgrade to at least bosh kit 2.3.0 before upgrading to v3.x.x"
if [[ -n "$FORCE_INCOMPATIBLE_UPGRADE" ]] ; then
describe >&2 " #y{[WARN]} Forcing incompatible upgrade due to FORCE_INCOMPATIBLE_UPGRADE being set"
else
ok=no
fi
fi
fi
set -e
fi

if [[ "$ok" == "yes" ]]; then
describe " environment files [#G{OK}]"
else
Expand Down

0 comments on commit 8231a32

Please sign in to comment.