mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
fix(config): load defaults before load file
This commit is contained in:
parent
9af6aa504f
commit
d726ba4615
@ -10,7 +10,7 @@ SEMAPHORE_RUNNER_CONFIG_FILE="${SEMAPHORE_RUNNER_CONFIG_FILE:-/var/lib/semaphore
|
||||
SEMAPHORE_TMP_PATH="${SEMAPHORE_TMP_PATH:-/tmp/semaphore}"
|
||||
|
||||
SEMAPHORE_REGISTRATION_TOKEN="${SEMAPHORE_REGISTRATION_TOKEN:-}"
|
||||
SEMAPHORE_API_URL="${SEMAPHORE_API_URL:-}"
|
||||
SEMAPHORE_RUNNER_API_URL="${SEMAPHORE_RUNNER_API_URL:-}"
|
||||
SEMAPHORE_RUNNER_ONE_OFF="${SEMAPHORE_RUNNER_ONE_OFF:-false}"
|
||||
|
||||
# Create a config if it does not exist in the current config path
|
||||
@ -23,7 +23,7 @@ if [ ! -f "${SEMAPHORE_CONFIG_PATH}/config.json" ]; then
|
||||
"runner": {
|
||||
"registration_token": "${SEMAPHORE_REGISTRATION_TOKEN}",
|
||||
"config_file": "${SEMAPHORE_RUNNER_CONFIG_FILE}",
|
||||
"api_url": "${SEMAPHORE_API_URL}",
|
||||
"api_url": "${SEMAPHORE_RUNNER_API_URL}",
|
||||
"one_off": ${SEMAPHORE_RUNNER_ONE_OFF}
|
||||
}
|
||||
}
|
||||
|
@ -189,9 +189,9 @@ func (conf *ConfigType) ToJSON() ([]byte, error) {
|
||||
// ConfigInit reads in cli flags, and switches actions appropriately on them
|
||||
func ConfigInit(configPath string) {
|
||||
fmt.Println("Loading config")
|
||||
loadConfigDefaults()
|
||||
loadConfigFile(configPath)
|
||||
loadConfigEnvironment()
|
||||
loadConfigDefaults()
|
||||
|
||||
fmt.Println("Validating config")
|
||||
validateConfig()
|
||||
|
Loading…
Reference in New Issue
Block a user