Class StaleSiteCleanupReconciler

java.lang.Object
network.ike.plugin.reconcile.StaleSiteCleanupReconciler
All Implemented Interfaces:
SiteReconciler

public class StaleSiteCleanupReconciler extends Object implements SiteReconciler
Reconciler that removes deployed-site directories from the legacy scpexe deploy server (ReleaseSupport.SITE_DISK_BASE on ReleaseSupport.SITE_SSH_HOST).

Subsumes the retired ike:clean-site goal (IKE-Network/ike-issues#398). Most projects no longer use the scpexe mirror (#304 retired it as the canonical distribution channel in favor of GitHub Pages), but the directory may still exist from before that change and shows up in ike:site-publish -Dsite=removed runs as cleanup work.

Detect: read-only — does not SSH out to enumerate stale dirs (that would slow site-draft for every project even when nothing is wrong). Always reports SiteDriftReport.noDrift(String) during a forward-deploy draft; the uninstall path (triggered by -Dsite=removed) is the only time stale cleanup is in scope.

Apply: forward-deploy direction does nothing (this reconciler is uninstall-only). The forward DeployedSiteReconciler already publishes a fresh site.

Uninstall: SSH out and remove /srv/ike-site/<projectId>/ (the release subtree). The .staging / .old suffixes are handled by the same ssh rm -rf since they're inside the same project tree.

  • Constructor Details

    • StaleSiteCleanupReconciler

      public StaleSiteCleanupReconciler()
      Creates this reconciler instance.
  • Method Details

    • dimension

      public String dimension()
      Description copied from interface: SiteReconciler
      Human-readable name of the dimension this reconciler owns. Used as the heading in site-draft output.
      Specified by:
      dimension in interface SiteReconciler
      Returns:
      the dimension label, e.g. "Deployed site version"
    • optOutFlag

      public String optOutFlag()
      Description copied from interface: SiteReconciler
      The Maven property name (without the -D prefix) that opts out of this reconciler's apply pass. Setting the property to "false" skips this dimension on a given site-publish invocation.
      Specified by:
      optOutFlag in interface SiteReconciler
      Returns:
      the opt-out flag name, e.g. "updateSite"
    • detect

      public SiteDriftReport detect(SiteContext ctx)
      Description copied from interface: SiteReconciler
      Inspect deployed site state and report any drift this reconciler would correct. Read-only — must not mutate any remote state.
      Specified by:
      detect in interface SiteReconciler
      Parameters:
      ctx - the per-repo site context
      Returns:
      drift report; SiteDriftReport.noDrift(String) if nothing to do
    • apply

      public void apply(SiteContext ctx)
      Description copied from interface: SiteReconciler
      Apply reconciliation. Caller is responsible for checking SiteReconcilerOptions.isOptedOut(String) before invoking; implementations may also re-check defensively.
      Specified by:
      apply in interface SiteReconciler
      Parameters:
      ctx - the per-repo site context
    • uninstall

      public void uninstall(SiteContext ctx)
      Description copied from interface: SiteReconciler
      Apply the "uninstall" variant of this reconciler — used by site-publish -Dsite=removed to tear down the deployed site and its registration. Default implementation does nothing (reconcilers that only forward-deploy can be inverted by the stale-cleanup reconciler instead).
      Specified by:
      uninstall in interface SiteReconciler
      Parameters:
      ctx - the per-repo site context