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

added code to display version as commit hash #85

Merged
merged 10 commits into from
Jun 12, 2024
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test: fmt vet $(GINKGO)
## install: Build and install kuadrantctl binary ($GOBIN or GOPATH/bin)
.PHONY : install
install: fmt vet
$(MAKE) update-version
GOBIN=$(PROJECT_PATH)/bin $(GO) install

.PHONY: prepare-local-cluster
Expand Down Expand Up @@ -74,5 +75,10 @@ fmt:
vet:
$(GO) vet ./...

.PHONY: update-version
update-version:
@commit_hash=$$(git rev-parse --short=7 HEAD); \
sed -i.bak 's/Version = "v0.0.0"/Version = "dev - '$${commit_hash}'"/' version/version.go && rm version/version.go.bak
ehearneRedHat marked this conversation as resolved.
Show resolved Hide resolved

# Include last to avoid changing MAKEFILE_LIST used above
include ./make/*.mk
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@

### Compiling from Source

If you prefer to compile from source or are contributing to the project, you can install `kuadrantctl` using `go install`. This method requires Golang 1.21 or newer.
ehearneRedHat marked this conversation as resolved.
Show resolved Hide resolved
If you prefer to compile from source or are contributing to the project, you can install `kuadrantctl` using `go install` or `make install`. This method requires Golang 1.21 or newer.

```bash
go install github.com/kuadrant/kuadrantctl@latest
ehearneRedHat marked this conversation as resolved.
Show resolved Hide resolved
```

This command will compile `kuadrantctl` and install the binary executable in `$GOBIN` (defaulting to `$GOPATH/bin`).

It is also possible to use the make target `install` to compile from source. From root of the repository, run

```bash
make install
```

This will compile `kuadrantctl` and install it in the `bin` directory at root of directory. It will also ensure the correct version of the binary is displayed, rather than `v0.0.0` . It can be ran using `./bin/kuadrantctl` .
ehearneRedHat marked this conversation as resolved.
Show resolved Hide resolved

## Usage

Below is a high-level overview of its commands, along with links to detailed documentation for more complex commands.
Expand Down
Loading