deploy: Configure timezone in entrypoint script

This commit is contained in:
John Colvin committed 2026-03-26 16:20:41 -04:00
1 parent 83df96c70f
commit e1d33ecadf
2 files changed
+14

No files matched your search

+3
View File
@@ -29,6 +29,9 @@
# tools/deploy.sh --help
#
### Host/Runtime ###
TZ=Etc/UTC
### Sparkd ###
# The internal image for sparkd to use. For more info, view:
# src/server/sparkd/Dockerfile
+11
View File
@@ -1,5 +1,15 @@
#!/usr/bin/env bash
init_timezone() {
tz="${1:-$TZ}"
zoneinfo_dir=/usr/share/zoneinfo
if [ -f "$zoneinfo_dir/$tz" -a "$(readlink -f /etc/localtime)" != "$zoneinfo_dir/$tz" ]; then
echo "Initializing locales and timezone"
ln -snf "$zoneinfo_dir/$tz" /etc/localtime
sudo echo $tz > /etc/timezone
fi
}
load_env() {
f="$1"
if [ -e "$f" ]; then
@@ -29,6 +39,7 @@ roll_log() {
data_root="${HOME:-/home/bts}/.local/share/bts/sparkd"
echo bts | sudo -S chown -R bts:bts "$data_root"
load_env "$data_root/conf/.env.local"
init_timezone "$TZ"
roll_log "$data_root/data/logging.sparkd/log"
symlink "$data_root/conf/plugins" /home/bts/bin/plugins
bash -c "${@:-./sparkd run}"