From 202f7ce561caecc059695980f4a7be749ef422fe Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 4 Aug 2021 23:52:34 +0200 Subject: [PATCH] WIP: spec'ing out the release command See https://git.coopcloud.tech/coop-cloud/go-abra/issues/39. --- cli/recipe/recipe.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/cli/recipe/recipe.go b/cli/recipe/recipe.go index d59629d9f..7ed08f215 100644 --- a/cli/recipe/recipe.go +++ b/cli/recipe/recipe.go @@ -149,6 +149,38 @@ var recipeCreateCommand = &cli.Command{ }, } +var recipeReleaseCommand = &cli.Command{ + Name: "release", + Usage: "Release a new recipe version", + ArgsUsage: "", + Action: func(c *cli.Context) error { + recipe := c.Args().First() + if recipe == "" { + internal.ShowSubcommandHelpAndError(c, errors.New("no recipe provided")) + } + + //TODO: read all local tags and read all upstream tags + // and then ask which you'd like to upgrade to + // ensure that this release isn't in local or upstream already + // after each choice, make change and show diff + + //TODO: read the apps catalogue and read the latest version of the recipe + // read the latest local tag of the recipe + // if there are no new changes, and upstream/local point to same commit, there is nothing to update, bail + // if there are changes and the commit they both point to is different, then this is a new release + // figure out the new version + // if the catalogue latest and the local latest are the same, N+1 release + // otherwise, use the local latest tag as the new version + // apply that version to all labels and show diff + + //TODO: offer to commit all the things + // offer to make a git tag for that with the new version + // offer to git push that upstream + + return nil + }, +} + var recipeLintCommand = &cli.Command{ Name: "lint", Usage: "Recipe configuration linter", @@ -253,6 +285,7 @@ how reliable this app is to deploy and maintain in its current state. recipeListCommand, recipeVersionCommand, recipeCreateCommand, + recipeReleaseCommand, recipeLintCommand, }, }