Merge pull request #1442 from lheckemann/gitlab-runner-fix
gitlab-runner: write config as toml, don't clobber existing file
This commit is contained in:
commit
f88be00227
1 changed files with 7 additions and 6 deletions
|
|
@ -19,6 +19,7 @@ let
|
|||
# make config file readable by service
|
||||
chown -R --reference=$HOME $(dirname ${configPath})
|
||||
'' else ''
|
||||
set -e
|
||||
export CONFIG_FILE=${configPath}
|
||||
|
||||
mkdir -p $(dirname ${configPath})
|
||||
|
|
@ -92,8 +93,8 @@ let
|
|||
done
|
||||
|
||||
# update global options
|
||||
remarshal --if toml --of json ${configPath} \
|
||||
| jq -cM ${escapeShellArg (concatStringsSep " | " [
|
||||
tomlq -t \
|
||||
${escapeShellArg (concatStringsSep " | " [
|
||||
".check_interval = ${toJSON cfg.checkInterval}"
|
||||
".concurrent = ${toJSON cfg.concurrent}"
|
||||
".sentry_dsn = ${toJSON cfg.sentryDSN}"
|
||||
|
|
@ -103,9 +104,9 @@ let
|
|||
".session_server.session_timeout = ${toJSON cfg.sessionServer.sessionTimeout}"
|
||||
"del(.[] | nulls)"
|
||||
"del(.session_server[] | nulls)"
|
||||
])} \
|
||||
| remarshal --if json --of toml \
|
||||
| sponge ${configPath}
|
||||
])} ${configPath} \
|
||||
> config.toml.new
|
||||
mv config.toml.new ${configPath}
|
||||
|
||||
# make config file readable by service
|
||||
chown -R --reference=$HOME $(dirname ${configPath})
|
||||
|
|
@ -559,7 +560,7 @@ in
|
|||
gawk
|
||||
jq
|
||||
moreutils
|
||||
remarshal
|
||||
yq
|
||||
# util-linux
|
||||
cfg.package
|
||||
coreutils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue