From 01913e2afc2035a79bbdaf154c8b068eaeb7d678 Mon Sep 17 00:00:00 2001 From: icyleaf Date: Fri, 27 Sep 2024 02:17:57 +0000 Subject: [PATCH] chore: split precheck and upgrade zealot task in docker mode --- docker/rootfs/etc/cont-init.d/20-init-zealot | 14 ++++++++------ docker/rootfs/etc/cont-init.d/25-upgrade-zealot | 5 ----- docker/rootfs/etc/cont-init.d/30-zealot-upgrade | 5 +++++ docker/rootfs/etc/cont-init.d/31-zealot-precheck | 4 ++++ lib/tasks/zealot/zealot.rake | 3 ++- 5 files changed, 19 insertions(+), 12 deletions(-) delete mode 100644 docker/rootfs/etc/cont-init.d/25-upgrade-zealot create mode 100644 docker/rootfs/etc/cont-init.d/30-zealot-upgrade create mode 100644 docker/rootfs/etc/cont-init.d/31-zealot-precheck diff --git a/docker/rootfs/etc/cont-init.d/20-init-zealot b/docker/rootfs/etc/cont-init.d/20-init-zealot index 251788fa5..769652c33 100644 --- a/docker/rootfs/etc/cont-init.d/20-init-zealot +++ b/docker/rootfs/etc/cont-init.d/20-init-zealot @@ -6,19 +6,21 @@ cd /app rm -f tmp/pids/.pid mkdir -p tmp/pids tmp/cache tmp/uploads tmp/sockets log -echo "!!!!!!!!!!!! BREAKING CHANGES !!!!!!!!!!!!" -echo "Zealot removes -> redis <- dependency, refactors backup feature completely." -echo "If you have any problems with running, please refer to: https://github.com/tryzealot/zealot/pull/1318" -echo "!!!!!!!!!!!! BREAKING CHANGES !!!!!!!!!!!!" +echo "" +echo "Zealot 6.0 is comming soon, here is some changes: " +echo " * redis is not requires as a dependency, you can remove it saftly." +echo " * NEW WEB UI desgin rewrite, feedback is welcome with any issue." +echo " * Swagger API explorer is buit-in." +echo "" if [ -n "$REDIS_URL" ]; then echo case $REDIS_URL in *redis:*|localhost:*|127.0.0.1:*) - echo "-> Detected REDIS_URL and redis service, you can remove redis service and the variable." + echo "[WARN] Detected REDIS_URL and redis service, you can remove redis service and the variable." ;; *) - echo "-> Detected REDIS_URL variable, you can remove the variable." + echo "[WARN] Detected REDIS_URL variable, you can remove the variable." ;; esac fi diff --git a/docker/rootfs/etc/cont-init.d/25-upgrade-zealot b/docker/rootfs/etc/cont-init.d/25-upgrade-zealot deleted file mode 100644 index 8a04cc971..000000000 --- a/docker/rootfs/etc/cont-init.d/25-upgrade-zealot +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv sh - -cd /app -./bin/rails zealot:precheck && ./bin/rails zealot:upgrade -exit 0 diff --git a/docker/rootfs/etc/cont-init.d/30-zealot-upgrade b/docker/rootfs/etc/cont-init.d/30-zealot-upgrade new file mode 100644 index 000000000..ae0c68ca0 --- /dev/null +++ b/docker/rootfs/etc/cont-init.d/30-zealot-upgrade @@ -0,0 +1,5 @@ +#!/usr/bin/with-contenv sh + +cd /app +./bin/rails zealot:upgrade +exit 0 diff --git a/docker/rootfs/etc/cont-init.d/31-zealot-precheck b/docker/rootfs/etc/cont-init.d/31-zealot-precheck new file mode 100644 index 000000000..7117a7632 --- /dev/null +++ b/docker/rootfs/etc/cont-init.d/31-zealot-precheck @@ -0,0 +1,4 @@ +#!/usr/bin/with-contenv sh + +cd /app +./bin/rails zealot:precheck diff --git a/lib/tasks/zealot/zealot.rake b/lib/tasks/zealot/zealot.rake index 3d5f0e535..74599c7ba 100644 --- a/lib/tasks/zealot/zealot.rake +++ b/lib/tasks/zealot/zealot.rake @@ -30,8 +30,9 @@ namespace :zealot do fail smtp_validator.error_message exit! end + echo "SMTP verified successful" else - puts "smtp is not configure, skip" + puts "SMTP is not configure, skip" end end end