Patch config before release

This commit is contained in:
wpetit 2020-04-30 10:18:45 +02:00
parent 7ca21ca524
commit db9afe54b5
4 changed files with 17 additions and 13 deletions

View File

@ -45,6 +45,9 @@ watch:
lint:
golangci-lint run --enable-all
tooling:
go get github.com/krishicks/yaml-patch/cmd/yaml-patch
clean:
rm -rf release
rm -rf data

View File

@ -0,0 +1,10 @@
---
- op: replace
path: /data/path
value: /var/lib/fake-smtp/data.db
- op: replace
path: /smtp/address
value: 127.0.0.1:2525
- op: replace
path: /smtp/debug
value: false

View File

@ -75,10 +75,12 @@ function dump_default_conf {
local os=$2
local arch=$3
local tmp_conf=$(mktemp)
local patched_conf=$(mktemp)
go run "$PROJECT_DIR/cmd/$command" -dump-config > "$tmp_conf"
copy "$command" $os $arch "$tmp_conf" "$command.yml"
rm -f "$tmp_conf"
cat "$tmp_conf" | yaml-patch -o misc/release/config-patch.yml > "$patched_conf"
copy "$command" $os $arch "$patched_conf" "config.yml"
rm -f "$tmp_conf" "$patched_conf"
}
function compress {

View File

@ -1,11 +0,0 @@
[Unit]
Description=fake-smtp
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/fake-smtp -workdir /usr/local/share/fake-smtp -config /etc/fake-smtp/config.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target