a deploy publishes a generation the new binary built
Signed-off-by: dawn <90008@klbr.net>
353 unmodified linesExpand all354355356357358358359360360361362362363364365366367368369370371372373374375101 unmodified linesExpand all353 unmodified linesExpand all timerConfig.OnBootSec = "5min"; };
# a new binary may serve from files the old one didn't write, lay them out now # instead of in the first write after the switch # instead of in the first write after the switch, then publish what it builds systemd.services.knot-static-prepare = { description = "lay out what a new knot-static serves from"; description = "lay out what a new knot-static serves from and publish it"; wantedBy = [ "multi-user.target" ]; after = [ "knot-static-nginx.service" ]; restartTriggers = [ cfg.package ]; restartTriggers = [ cfg.package config.environment.etc."knot-static/config.toml".source ]; # activate runs reload_command through sh path = [ pkgs.gitMinimal pkgs.bash ]; unitConfig.ConditionPathExists = cfg.environmentFile; serviceConfig = { Type = "oneshot"; RemainAfterExit = true;101 unmodified linesExpand all113 unmodified linesExpand all114115116117118118119120121122307 unmodified linesExpand all113 unmodified linesExpand all /// when the activation happened, in unix seconds #[arg(long)] at: u64, }, /// after a deploy, lay out what this binary serves from before a write has to /// after a deploy, lay out what this binary serves from and publish a generation it built #[command(hide = true)] Prepare, /// ask configured crawlers to crawl this knot now Crawl,307 unmodified linesExpand all206 unmodified linesExpand all20720820921021121221121221321421521621721821922022122295 unmodified lines206 unmodified linesExpand all previous, at, } => activate::after_activation(&config, &generation, previous.as_deref(), at), Command::Prepare => { let written = git_xrpc::prepare(&config.output_root)?; eprintln!("prepared the git read maps of {written} repos"); // a failure leaves the old generation serving, the deploy goes on match git_xrpc::prepare(&config.output_root) { Ok(written) => eprintln!("prepared the git read maps of {written} repos"), Err(error) => tracing::error!("prepare the git read maps: {error:#}"), } if let Err(error) = writes::publish_scoped(&config, None).await { tracing::error!("rebuild with the new binary: {error:#}"); } Ok(()) } Command::Crawl => { crawl::request_all(&config).await;95 unmodified lines