mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-02 21:44:51 +02:00
chore(housekeeping): Create helpers/change-detection.sh
(#2610)
* chore: Extract change-detection method to it's own helper This doesn't really belong in `helpers/ssl.sh`. Moving to it's own helper script. * chore: Co-locate related change-detection method from container startup It seems relevant to migrate the related support during startup for the change detection feature into this helper. I opted to move the call from `start-mailserver.sh` into the `_setup` call at the end for a more explicit/visible location. * chore: Move `CHKSUM_FILE` into `helpers/change-detection.sh` It belongs there, not in `helpers/index.sh`. * chore: Revise inline documentation * tests(fix): Ensure correct functionality Presently `test/test_helper.bats` is using it's own `CHKSUM_FILE` instead of sourcing the var for the filepath. `test_helper/common.bash` was calling a method to check for changes, but this helper may not correctly detect letsencrypt related changes as these are not ENV rely on, but global vars handled by `helpers/dns.sh`, so that should be run first like it is for `check-for-changes.sh`. * tests(chore): Use `CHKSUM_FILE` var from helper * chore: `addmailuser` should use `CHKSUM_FILE` var * chore: Update `check-for-changes.sh` log message with correct path
This commit is contained in:
parent
598aee166c
commit
c862e1451d
9 changed files with 92 additions and 86 deletions
|
@ -3,23 +3,13 @@
|
|||
# shellcheck source-path=target/scripts/helpers
|
||||
# This file serves as a single import for all helpers
|
||||
|
||||
# Global checksum file mainly needed for the changedetector.
|
||||
# Used in the folling scripts:
|
||||
#
|
||||
# - ../check-for-changes.sh
|
||||
# - ../start-mailserver.sh
|
||||
# - ../startup/setup-stack.sh
|
||||
# - ../../../test/test_helper/common.bash
|
||||
#
|
||||
# shellcheck disable=SC2034
|
||||
CHKSUM_FILE=/tmp/docker-mailserver-config-chksum
|
||||
|
||||
function _import_scripts
|
||||
{
|
||||
local PATH_TO_SCRIPTS='/usr/local/bin/helpers'
|
||||
|
||||
source "${PATH_TO_SCRIPTS}/accounts.sh"
|
||||
source "${PATH_TO_SCRIPTS}/aliases.sh"
|
||||
source "${PATH_TO_SCRIPTS}/change-detection.sh"
|
||||
source "${PATH_TO_SCRIPTS}/dns.sh"
|
||||
source "${PATH_TO_SCRIPTS}/error.sh"
|
||||
source "${PATH_TO_SCRIPTS}/lock.sh"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue