Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main branch should use different version from the releases #351

Open
amohamed1 opened this issue Jan 24, 2022 · 0 comments
Open

main branch should use different version from the releases #351

amohamed1 opened this issue Jan 24, 2022 · 0 comments

Comments

@amohamed1
Copy link

When building from main, the version should include -main or/and GIT_COMMIT_ID-dirty
to make sure users don't get confused which version they are using. Today, if a user
clones the git tree, build the binary and replace ocm-cli in a running system it will look
like they installed/deployed the version 0.1.60 (based on ocm-cli version). Which is not true.
Of course, sysadmins can always check the sha256 from the binary but it's hard to assume steps
for all people/orgs.

Example:

Cloning

$ git clone https://github.com/openshift-online/ocm-cli.git && cd ocm-cli
Cloning into 'ocm-cli'...
remote: Enumerating objects: 4284, done.
remote: Counting objects: 100% (1386/1386), done.
remote: Compressing objects: 100% (523/523), done.
remote: Total 4284 (delta 711), reused 1227 (delta 624), pack-reused 2898
Receiving objects: 100% (4284/4284), 1.08 MiB | 6.82 MiB/s, done.
Resolving deltas: 100% (2206/2206), done.

Building

$ make
for cmd in $(ls cmd); do \
    go build "./cmd/${cmd}" || exit 1; \
done
go: downloading github.com/golang/glog v1.0.0
go: downloading github.com/spf13/cobra v1.3.0
go: downloading github.com/golang-jwt/jwt/v4 v4.2.0
go: downloading github.com/openshift-online/ocm-sdk-go v0.1.234
go: downloading github.com/AlecAivazis/survey/v2 v2.2.15
go: downloading github.com/aws/aws-sdk-go v1.42.27
go: downloading github.com/openshift/rosa v1.1.7
go: downloading github.com/m1/go-generate-password v0.1.1
go: downloading github.com/nwidger/jsoncolor v0.3.0
go: downloading gitlab.com/c0b/go-ordered-json v0.0.0-20201030195603-febf46534d5a
go: downloading github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
go: downloading github.com/hashicorp/go-version v1.4.0
go: downloading golang.org/x/term v0.0.0-20210503060354-a79de5458b56
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading github.com/cenkalti/backoff/v4 v4.0.0
go: downloading github.com/prometheus/client_golang v1.9.0
go: downloading github.com/google/uuid v1.2.0
go: downloading github.com/microcosm-cc/bluemonday v1.0.16
go: downloading golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
go: downloading github.com/cespare/xxhash/v2 v2.1.2
go: downloading github.com/prometheus/common v0.15.0
go: downloading github.com/prometheus/procfs v0.2.0
go: downloading github.com/aymerick/douceur v0.2.0
go: downloading github.com/gorilla/css v1.0.0

Getting the version from the build

$ ./ocm version (local build)
0.1.60

$ sha256sum ./ocm
03e1ef46c16a3b3997e9bb071997ba298c5412be8c89cca349f3b62c1cd611a1  ./ocm

Downloading official release
$ wget https://github.com/openshift-online/ocm-cli/releases/download/v0.1.60/ocm-darwin-amd64

$ ./ocm-darwin-amd64 version
0.1.60

$ sha256sum ocm-darwin-amd64
45ba3ea71cd73e0c53ed40188c35705de55a02d1878ad8d00d86cc56146d3932  ocm-darwin-amd64

Official release info: https://github.com/openshift-online/ocm-cli/releases/tag/v0.1.60
github-actions released this Dec 03, 2021· 18 commits to main since this release v0.1.60 f16d2ea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant