Mercurial
diff mrjunejune/deploy.sh @ 270:358dd5950985
sync production config on every deploy
Always install the ignored repository .config into /etc/mrjunejune before promoting the new bundle.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 07 Aug 2026 13:16:47 -0700 |
| parents | de291f396881 |
| children |
line wrap: on
line diff
--- a/mrjunejune/deploy.sh Fri Aug 07 13:08:10 2026 -0700 +++ b/mrjunejune/deploy.sh Fri Aug 07 13:16:47 2026 -0700 @@ -10,19 +10,16 @@ production_config="/etc/mrjunejune/.config" # The real config is ignored and intentionally excluded from the immutable -# bundle. Install it once into the service-owned system location; preserve the -# existing production config on subsequent deployments. -if ! sudo test -f "$production_config"; then - if [[ ! -f "$source_config" ]]; then - echo "Missing initial config: $source_config" >&2 - exit 1 - fi - sudo install -d -o mrjunejune_server -g zenbu_team -m 0750 \ - "$(dirname "$production_config")" - sudo install -o mrjunejune_server -g zenbu_team -m 0640 \ - "$source_config" "$production_config" - echo "Installed initial production config at $production_config" +# bundle. Synchronize the repository's service config on every deployment. +if [[ ! -f "$source_config" ]]; then + echo "Missing deployment config: $source_config" >&2 + exit 1 fi +sudo install -d -o mrjunejune_server -g zenbu_team -m 0750 \ + "$(dirname "$production_config")" +sudo install -o mrjunejune_server -g zenbu_team -m 0640 \ + "$source_config" "$production_config" +echo "Updated production config at $production_config" # Always create staging from an empty directory. Copying into an existing # directory nests the bundle and can promote stale/incomplete runtime files.