refactor!: simplifying publish logic

This commit is contained in:
2021-12-27 19:56:27 +01:00
parent eb1b6be4c5
commit 0aa37fcee8
10 changed files with 137 additions and 168 deletions

View File

@ -18,7 +18,7 @@ import (
var recipeSyncCommand = &cli.Command{
Name: "sync",
Usage: "Ensure recipe version labels are up-to-date",
Usage: "Sync recipe version label",
Aliases: []string{"s"},
ArgsUsage: "<recipe> [<version>]",
Flags: []cli.Flag{
@ -29,23 +29,21 @@ var recipeSyncCommand = &cli.Command{
},
Description: `
This command will generate labels for the main recipe service (i.e. by
convention, the service named "app") which corresponds to the following format:
convention, the service named 'app') which corresponds to the following format:
coop-cloud.${STACK_NAME}.version=<version>
The <version> is determined by the recipe maintainer and is specified on the
command-line. The <recipe> configuration will be updated on the local file
system.
You may invoke this command in "wizard" mode and be prompted for input:
abra recipe sync
Where <version> can be specifed on the command-line or Abra can attempt to
auto-generate it for you. The <recipe> configuration will be updated on the
local file system.
`,
Action: func(c *cli.Context) error {
recipe := internal.ValidateRecipeWithPrompt(c)
mainApp := internal.GetMainApp(recipe)
mainApp, err := internal.GetMainAppImage(recipe)
if err != nil {
logrus.Fatal(err)
}
imagesTmp, err := getImageVersions(recipe)
if err != nil {