Skip to content

Commit

Permalink
Make release a little easier (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjb authored Nov 15, 2023
1 parent 34df536 commit 1a2b27b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,11 @@ cli-docs: ## generate cli documenation
check-cli-docs: cli-docs
git diff --exit-code -- docs/content/reference/

.PHONY: prep-release
prep-release:
@echo "Replace $(OLD_VERSION) with $(NEW_VERSION)"
sed -i "s/$${OLD_VERSION}/$${NEW_VERSION}/" internal/cmd/client_version.go docs/config.toml
touch docs/content/releases/$(NEW_VERSION).md

prep-release-docs: prep-release cli-docs

18 changes: 18 additions & 0 deletions internal/cmd/client_version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2021 - 2023 Crunchy Data Solutions, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cmd

// store the current PGO CLI version
const clientVersion = "v0.3.0"
3 changes: 0 additions & 3 deletions internal/cmd/pgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import (
"github.com/crunchydata/postgres-operator-client/internal"
)

// store the current PGO CLI version
const clientVersion = "v0.3.0"

// NewPGOCommand returns the root command of the PGO plugin. This command
// prints the same information as its --help flag: the available subcommands
// and their short descriptions.
Expand Down
7 changes: 4 additions & 3 deletions internal/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package cmd

import (
"context"
"fmt"

"github.com/spf13/cobra"
v1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
Expand Down Expand Up @@ -46,12 +47,12 @@ func newVersionCommand(config *internal.Config) *cobra.Command {
// No arguments for 'version'
cmd.Args = cobra.NoArgs

cmd.Example = internal.FormatExample(`# Request the version of the client and the operator
cmd.Example = internal.FormatExample(fmt.Sprintf(`# Request the version of the client and the operator
pgo version
### Example output
Client Version: v0.3.0
Operator Version: v5.5.0`)
Client Version: %s
Operator Version: v5.5.0`, clientVersion))

cmd.RunE = func(cmd *cobra.Command, args []string) error {

Expand Down

0 comments on commit 1a2b27b

Please sign in to comment.