Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 38b4220

Browse files
authored
Merge pull request #1603 from gtardif/compose-cli-plugin-version
Separate compose CLI plugin version from Cloud integration version
2 parents 9370ca3 + 28bd7bd commit 38b4220

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

builder.Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ STATIC_FLAGS=CGO_ENABLED=0
2828

2929
GIT_TAG?=$(shell git describe --tags --match "v[0-9]*")
3030

31-
LDFLAGS="-s -w -X $(PKG_NAME)/internal.Version=${GIT_TAG}"
31+
LDFLAGS="-s -w -X $(PKG_NAME)/internal.Version=${GIT_TAG} -X $(PKG_NAME)/internal.ComposePluginVersion=2.0.0-beta.1"
3232
GO_BUILD=$(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS)
3333

3434
BINARY?=bin/docker

cli/cmd/compose/version.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ type versionOptions struct {
3434
func versionCommand() *cobra.Command {
3535
opts := versionOptions{}
3636
cmd := &cobra.Command{
37-
Use: "version",
38-
Short: "Show the Docker Compose version information",
39-
Args: cobra.MaximumNArgs(0),
37+
Use: "version",
38+
Short: "Show the Docker Compose version information",
39+
Args: cobra.MaximumNArgs(0),
40+
Hidden: true,
4041
RunE: func(cmd *cobra.Command, _ []string) error {
4142
runVersion(opts)
4243
return nil
@@ -51,7 +52,7 @@ func versionCommand() *cobra.Command {
5152
}
5253

5354
func runVersion(opts versionOptions) {
54-
displayedVersion := strings.TrimPrefix(internal.Version, "v")
55+
displayedVersion := strings.TrimPrefix(internal.ComposePluginVersion, "v")
5556
if opts.short {
5657
fmt.Println(displayedVersion)
5758
return

internal/variables.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ const (
2626
var (
2727
// Version is the version of the CLI injected in compilation time
2828
Version = "dev"
29+
// ComposePluginVersion is the version of the compose cli plugin, injected in compilation time
30+
ComposePluginVersion = "dev"
2931
)

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ func main() {
6161
manager.Metadata{
6262
SchemaVersion: "0.1.0",
6363
Vendor: "Docker Inc.",
64-
Version: strings.TrimPrefix(internal.Version, "v"),
64+
Version: strings.TrimPrefix(internal.ComposePluginVersion, "v"),
6565
})
6666
}

0 commit comments

Comments
 (0)