deploy: Configure timezone in entrypoint script
This commit is contained in:
1 parent
83df96c70f
commit
e1d33ecadf
2 files changed
+14
No files matched your search
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
Reference in new issue
Block a user