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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
GO ?= go
KUADRANT_NAMESPACE=kuadrant-system
ehearneRedHat marked this conversation as resolved.
Show resolved Hide resolved
VERSION := $(shell git rev-parse --short=7 HEAD)

all: help

Expand Down Expand Up @@ -41,7 +42,11 @@ test: fmt vet $(GINKGO)
## install: Build and install kuadrantctl binary ($GOBIN or GOPATH/bin)
.PHONY : install
install: fmt vet
ifneq ($(VERSION),)
GOBIN=$(PROJECT_PATH)/bin $(GO) install -ldflags "-X 'github.com/kuadrant/kuadrantctl/version.Version=dev - $(VERSION)'"
else
GOBIN=$(PROJECT_PATH)/bin $(GO) install
endif

.PHONY: prepare-local-cluster
prepare-local-cluster: $(KIND) ## Deploy locally kuadrant operator from the current code
Expand Down
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