services/templates/forgejo/entrypoint.sh.gotmpl
Dan Anglin 3340ddc475
build: automation with Go and Mage
We shall now use Go and Mage to manage the Flow services. The templates
have been converted to Go templates, Mage has replaced Make and the
helper bash scripts have been rewritten in Go.
2023-02-12 20:59:55 +00:00

28 lines
661 B
Bash

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Create the home directory.
if ! [ -d {{ .Forgejo.Home }} ]; then
mkdir -p {{ .Forgejo.Home }}
chmod 0700 {{ .Forgejo.Home }}
fi
# Create the custom directory.
if ! [ -d {{ .Forgejo.Custom }} ]; then
mkdir -p {{ .Forgejo.Custom }}
chmod 0500 {{ .Forgejo.Custom }}
fi
# Move the dynamic Traefik config to the shared volume.
if [ -f /flow/gitea/tmp/dynamic_git.yaml ]; then
mv /flow/gitea/tmp/dynamic_git.yaml {{ .Traefik.SharedMountPoint }}/dynamic/dynamic_git.yaml
fi
if [ $# -gt 0 ]; then
exec "$@"
else
exec {{ .Forgejo.Bin }} -c {{ .Forgejo.AppIni }} web
fi