forked from toolshed/abra
		
	feat: -a/--all-tags for listing all tags on recipe upgrade
This commit is contained in:
		@ -438,6 +438,15 @@ var RegistryPasswordFlag = &cli.StringFlag{
 | 
			
		||||
	Destination: &RegistryUsername,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var AllTags bool
 | 
			
		||||
var AllTagsFlag = &cli.BoolFlag{
 | 
			
		||||
	Name:        "all-tags",
 | 
			
		||||
	Aliases:     []string{"a"},
 | 
			
		||||
	Value:       false,
 | 
			
		||||
	Usage:       "List all tags, not just upgrades",
 | 
			
		||||
	Destination: &AllTags,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SSHFailMsg is a hopefully helpful SSH failure message
 | 
			
		||||
var SSHFailMsg = `
 | 
			
		||||
Woops, Abra is unable to connect to connect to %s.
 | 
			
		||||
 | 
			
		||||
@ -53,6 +53,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
		internal.PatchFlag,
 | 
			
		||||
		internal.MinorFlag,
 | 
			
		||||
		internal.MajorFlag,
 | 
			
		||||
		internal.AllTagsFlag,
 | 
			
		||||
	},
 | 
			
		||||
	Action: func(c *cli.Context) error {
 | 
			
		||||
		recipe := internal.ValidateRecipeWithPrompt(c)
 | 
			
		||||
@ -151,7 +152,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
 | 
			
		||||
			sort.Sort(tagcmp.ByTagDesc(compatible))
 | 
			
		||||
 | 
			
		||||
			if len(compatible) == 0 {
 | 
			
		||||
			if len(compatible) == 0 && !internal.AllTags {
 | 
			
		||||
				logrus.Info(fmt.Sprintf("no new versions available for %s, %s is the latest", image, tag))
 | 
			
		||||
				continue // skip on to the next tag and don't update any compose files
 | 
			
		||||
			}
 | 
			
		||||
@ -219,9 +220,11 @@ You may invoke this command in "wizard" mode and be prompted for input:
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					msg := fmt.Sprintf("upgrade to which tag? (service: %s, image: %s, tag: %s)", service.Name, image, tag)
 | 
			
		||||
					if !tagcmp.IsParsable(img.(reference.NamedTagged).Tag()) {
 | 
			
		||||
					if !tagcmp.IsParsable(img.(reference.NamedTagged).Tag()) || internal.AllTags {
 | 
			
		||||
						tag := img.(reference.NamedTagged).Tag()
 | 
			
		||||
						logrus.Warning(fmt.Sprintf("unable to determine versioning semantics of %s, listing all tags", tag))
 | 
			
		||||
						if !internal.AllTags {
 | 
			
		||||
							logrus.Warning(fmt.Sprintf("unable to determine versioning semantics of %s, listing all tags", tag))
 | 
			
		||||
						}
 | 
			
		||||
						msg = fmt.Sprintf("upgrade to which tag? (service: %s, tag: %s)", service.Name, tag)
 | 
			
		||||
						compatibleStrings = []string{"skip"}
 | 
			
		||||
						for _, regVersion := range regVersions {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user