diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b9983e..8e7e93f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- [#128] Move state that should be persistent between restarts to local config. ## [v5.0.8-1] - 2024-03-07 ### Changed diff --git a/docs/development/figures/post_upgrade_workflow.puml b/docs/development/figures/post_upgrade_workflow.puml index a4b873d..9a48a45 100644 --- a/docs/development/figures/post_upgrade_workflow.puml +++ b/docs/development/figures/post_upgrade_workflow.puml @@ -34,6 +34,7 @@ endif :render templates and update plugins :execute command: doguctl state "upgrade done"; +:execute command: doguctl config --rm "local_state"; end diff --git a/docs/development/figures/pre_upgrade_workflow.puml b/docs/development/figures/pre_upgrade_workflow.puml index cd6b803..55ec966 100644 --- a/docs/development/figures/pre_upgrade_workflow.puml +++ b/docs/development/figures/pre_upgrade_workflow.puml @@ -10,7 +10,7 @@ endif if (FROM_VERSION is equal to TO_VERSION) then (yes) stop else (no) - :execute command: doguctl state "upgrading"; + :execute command: doguctl config "local_state" "upgrading"; endif if (is FROM_VERSION less or equal than "4.2.3-4") then (no) diff --git a/dogu.json b/dogu.json index ad5daaa..5f1e453 100644 --- a/dogu.json +++ b/dogu.json @@ -91,6 +91,13 @@ "Owner": "1000", "Group": "1000", "NeedsBackup": false + }, + { + "Name": "localConfig", + "Path": "/var/ces/config", + "Owner": "1000", + "Group": "1000", + "NeedsBackup": true } ], "ServiceAccounts": [ diff --git a/resources/post-upgrade.sh b/resources/post-upgrade.sh index c78d06d..826749a 100755 --- a/resources/post-upgrade.sh +++ b/resources/post-upgrade.sh @@ -70,6 +70,7 @@ function run_postupgrade() { echo "Set registry flag so startup script can start afterwards..." doguctl state "upgrade done" + doguctl config --rm "local_state" echo "Redmine post-upgrade done" } diff --git a/resources/pre-upgrade.sh b/resources/pre-upgrade.sh index b78b02e..6c8cc16 100755 --- a/resources/pre-upgrade.sh +++ b/resources/pre-upgrade.sh @@ -20,7 +20,7 @@ function run_preupgrade() { fi echo "Set registry flag so startup script waits for post-upgrade to finish..." - doguctl state "upgrading" + doguctl config "local_state" "upgrading" if versionXLessOrEqualThanY "${FROM_VERSION}" "4.2.3-4" ; then # this migration only needs to be done if the additional plugins volume was already created diff --git a/resources/startup.sh b/resources/startup.sh index 92123e2..8c7dc0b 100755 --- a/resources/startup.sh +++ b/resources/startup.sh @@ -35,7 +35,7 @@ sourceUtilExitCode=0 source "${STARTUP_DIR}"/util.sh || sourceUtilExitCode=$? if [[ ${sourceUtilExitCode} -ne 0 ]]; then echo "ERROR: An error occurred while sourcing util functions." - doguctl state "ErrorSourceUtilFunctions" + doguctl config "local_state" "ErrorSourceUtilFunctions" sleep 300 exit 2 fi @@ -63,7 +63,7 @@ function setDoguLogLevel() { function runMain() { # check whether post-upgrade script is still running - while [[ "$(doguctl state)" == "upgrading" ]]; do + while [[ "$(doguctl config "local_state" -d "empty")" == "upgrading" ]]; do echo "Upgrade script is running. Waiting..." sleep 3 done