fix(docker): bolt support

This commit is contained in:
Denis Gukov 2022-10-05 22:40:30 +05:00
parent e477e4d60a
commit 8bb37dc3cc
2 changed files with 17 additions and 15 deletions

View File

@ -27,17 +27,9 @@ var setupCmd = &cobra.Command{
//nolint: gocyclo
func doSetup() int {
var config *util.ConfigType
for {
config = &util.ConfigType{}
config.GenerateSecrets()
setup.InteractiveSetup(config)
if setup.AskConfigConfirmation(config) {
break
}
fmt.Println()
}
config = &util.ConfigType{}
config.GenerateSecrets()
setup.InteractiveSetup(config)
configPath := setup.SaveConfig(config)
util.Config = config

View File

@ -4,12 +4,13 @@ set -e
echoerr() { printf "%s\n" "$*" >&2; }
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/etc/semaphore}"
SEMAPHORE_CONFIG_PATH="${SEMAPHORE_CONFIG_PATH:-/tmp/semaphore}"
SEMAPHORE_TMP_PATH="${SEMAPHORE_TMP_PATH:-/tmp/semaphore}"
# Semaphore database env config
SEMAPHORE_DB_DIALECT="${SEMAPHORE_DB_DIALECT:-mysql}"
SEMAPHORE_DB_HOST="${SEMAPHORE_DB_HOST:-0.0.0.0}"
SEMAPHORE_DB_HOST="${SEMAPHORE_DB_HOST:-127.0.0.1}"
SEMAPHORE_DB_PATH="${SEMAPHORE_DB_PATH:-/tmp/semaphore/database}"
SEMAPHORE_DB_PORT="${SEMAPHORE_DB_PORT:-}"
SEMAPHORE_DB="${SEMAPHORE_DB:-semaphore}"
SEMAPHORE_DB_USER="${SEMAPHORE_DB_USER:-semaphore}"
@ -81,12 +82,22 @@ esac
# Create a config if it does not exist in the current config path
if [ ! -f "${SEMAPHORE_CONFIG_PATH}/config.json" ]; then
echoerr "Generating ${SEMAPHORE_TMP_PATH}/config.stdin ..."
cat << EOF > "${SEMAPHORE_TMP_PATH}/config.stdin"
if [ "${SEMAPHORE_DB_DIALECT}" = "bolt" ]; then
cat << EOF > "${SEMAPHORE_TMP_PATH}/config.stdin"
${SEMAPHORE_DB_DIALECT_ID}
${SEMAPHORE_DB_PATH}
EOF
else
cat << EOF >> "${SEMAPHORE_TMP_PATH}/config.stdin"
${SEMAPHORE_DB_DIALECT_ID}
${SEMAPHORE_DB_HOST}
${SEMAPHORE_DB_USER}
${SEMAPHORE_DB_PASS}
${SEMAPHORE_DB}
EOF
fi
cat << EOF >> "${SEMAPHORE_TMP_PATH}/config.stdin"
${SEMAPHORE_TMP_PATH}
${SEMAPHORE_WEB_ROOT}
no
@ -111,7 +122,6 @@ EOF
fi;
cat << EOF >> "${SEMAPHORE_TMP_PATH}/config.stdin"
yes
${SEMAPHORE_CONFIG_PATH}
${SEMAPHORE_ADMIN}
${SEMAPHORE_ADMIN_EMAIL}