feat: write undeploy version

See toolshed/organising#633
This commit is contained in:
2024-12-28 16:59:08 +01:00
committed by decentral1se
parent 866c5c4536
commit a0da5299fe
3 changed files with 69 additions and 4 deletions

View File

@ -21,7 +21,7 @@ var AppUndeployCommand = &cobra.Command{
Use: "undeploy <app> [flags]",
Aliases: []string{"un"},
Short: "Undeploy an app",
Long: `This does not destroy any of the application data.
Long: `This does not destroy any application data.
However, you should remain vigilant, as your swarm installation will consider
any previously attached volumes as eligible for pruning once undeployed.
@ -79,6 +79,11 @@ Passing "--prune/-p" does not remove those volumes.`,
log.Fatal(err)
}
}
log.Debugf("choosing %s as version to save to env file", deployMeta.Version)
if err := app.WriteRecipeVersion(deployMeta.Version, false); err != nil {
log.Fatalf("writing undeployed recipe version in env file: %s", err)
}
},
}