Skip to content

Commit

Permalink
Allow setting version through build cmd.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Tegnér <[email protected]>
  • Loading branch information
Johannestegner committed Mar 30, 2022
1 parent f701d78 commit 7a463fe
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import (
"context"
)

var VERSION = "unknown"

func main() {
plugin.Run(func(dockerCli command.Cli) *cobra.Command {
tag := &cobra.Command{
Use: "tag",
Args: cobra.MinimumNArgs(2),
Short: "Tag a source image with multiple extra tags.",
Use: "tag",
Args: cobra.MinimumNArgs(2),
Short: "Tag a source image with multiple extra tags.",
Example: "docker multi tag origin:tag target:tag target2:tag2 target3:tag",
Run: func(cmd *cobra.Command, args []string) {
origin := args[0]
Expand All @@ -35,9 +37,9 @@ func main() {
}

push := &cobra.Command{
Use: "push",
Args: cobra.MinimumNArgs(2),
Short: "Push multiple images in one command.",
Use: "push",
Args: cobra.MinimumNArgs(2),
Short: "Push multiple images in one command.",
Example: "docker multi push image:tag image:tag2 image:tag3",
Run: func(cmd *cobra.Command, args []string) {
for i := 1; i < len(args); i++ {
Expand All @@ -53,7 +55,7 @@ func main() {
}

cmd := &cobra.Command{
Use: "multi",
Use: "multi",
Short: "Batch-run commands.",
RunE: func(cmd *cobra.Command, args []string) error {
return nil
Expand All @@ -62,10 +64,10 @@ func main() {

cmd.AddCommand(tag, push)
return cmd
}, manager.Metadata {
}, manager.Metadata{
ShortDescription: "Docker CLI Plugin to allow for batch commands.",
SchemaVersion: "0.1.0",
Vendor: "Jitesoft",
Version: "0.0.1",
SchemaVersion: "0.1.0",
Vendor: "Jitesoft",
Version: VERSION,
})
}
}

0 comments on commit 7a463fe

Please sign in to comment.