forked from konveyor/tackle2-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using more traditional variable syntax.
Signed-off-by: Jeff Ortel <[email protected]>
- Loading branch information
Showing
1 changed file
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
GOBIN ?= ${GOPATH}/bin | ||
GOIMPORTS = ${GOBIN}/goimports | ||
CONTROLLERGEN = ${GOBIN}/controller-gen | ||
GOBIN ?= $(GOPATH)/bin | ||
GOIMPORTS = $(GOBIN)/goimports | ||
CONTROLLERGEN = $(GOBIN)/controller-gen | ||
IMG ?= tackle2-hub:latest | ||
HUB_BASE_URL ?= http://localhost:8080 | ||
|
||
|
@@ -27,38 +27,38 @@ PKG = ./addon/... \ | |
./test/... \ | ||
./tracker/... | ||
|
||
PKGDIR = $(subst /...,,${PKG}) | ||
PKGDIR = $(subst /...,,$(PKG)) | ||
|
||
BUILD = --tags json1 -o bin/hub github.com/konveyor/tackle2-hub/cmd | ||
|
||
# Build ALL commands. | ||
cmd: hub addon | ||
|
||
# Format the code. | ||
fmt: ${GOIMPORTS} | ||
goimports -w ${PKGDIR} | ||
fmt: $(GOIMPORTS) | ||
goimports -w $(PKGDIR) | ||
|
||
# Run go vet against code | ||
vet: | ||
go vet ${PKG} | ||
go vet $(PKG) | ||
|
||
# Build hub | ||
hub: generate fmt vet | ||
go build ${BUILD} | ||
go build $(BUILD) | ||
|
||
# Build image | ||
docker-build: | ||
docker build -t ${IMG} . | ||
docker build -t $(IMG) . | ||
|
||
podman-build: | ||
podman build -t ${IMG} . | ||
podman build -t $(IMG) . | ||
|
||
# Build manager binary with compiler optimizations disabled | ||
debug: generate fmt vet | ||
go build -gcflags=all="-N -l" ${BUILD} | ||
go build -gcflags=all="-N -l" $(BUILD) | ||
|
||
docker: vet | ||
go build ${BUILD} | ||
go build $(BUILD) | ||
|
||
# Run against the configured Kubernetes cluster in ~/.kube/config | ||
run: fmt vet | ||
|
@@ -68,21 +68,21 @@ run-addon: | |
go run ./hack/cmd/addon/main.go | ||
|
||
# Generate manifests e.g. CRD, Webhooks | ||
manifests: ${CONTROLLERGEN} | ||
${CONTROLLERGEN} ${CRD_OPTIONS} \ | ||
manifests: $(CONTROLLERGEN) | ||
$(CONTROLLERGEN) $(CRD_OPTIONS) \ | ||
crd rbac:roleName=manager-role \ | ||
paths="./..." output:crd:artifacts:config=generated/crd/bases output:crd:dir=generated/crd | ||
|
||
# Generate code | ||
generate: ${CONTROLLERGEN} | ||
${CONTROLLERGEN} object:headerFile="./generated/boilerplate" paths="./..." | ||
generate: $(CONTROLLERGEN) | ||
$(CONTROLLERGEN) object:headerFile="./generated/boilerplate" paths="./..." | ||
|
||
# Ensure controller-gen installed. | ||
${CONTROLLERGEN}: | ||
$(CONTROLLERGEN): | ||
go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# Ensure goimports installed. | ||
${GOIMPORTS}: | ||
$(GOIMPORTS): | ||
go install golang.org/x/tools/cmd/goimports@latest | ||
|
||
# Build SAMPLE ADDON | ||
|
@@ -93,7 +93,7 @@ docs: docs-html docs-openapi3 docs-binding | |
|
||
# Build Swagger API spec into ./docs directory | ||
docs-swagger: | ||
${GOBIN}/swag init -g pkg.go --dir api,assessment | ||
$(GOBIN)/swag init -g pkg.go --dir api,assessment | ||
|
||
# Build OpenAPI 3.0 docs | ||
docs-openapi3: docs-swagger | ||
|
@@ -111,25 +111,25 @@ docs-binding: | |
START_MINIKUBE_SH = ./bin/start-minikube.sh | ||
start-minikube: | ||
ifeq (,$(wildcard $(START_MINIKUBE_SH))) | ||
@{ \ | ||
@( \ | ||
set -e ;\ | ||
mkdir -p $(dir $(START_MINIKUBE_SH)) ;\ | ||
curl -sSLo $(START_MINIKUBE_SH) https://raw.githubusercontent.com/konveyor/tackle2-operator/main/hack/start-minikube.sh ;\ | ||
chmod +x $(START_MINIKUBE_SH) ;\ | ||
} | ||
) | ||
endif | ||
$(START_MINIKUBE_SH); | ||
|
||
.PHONY: install-tackle | ||
INSTALL_TACKLE_SH = ./bin/install-tackle.sh | ||
install-tackle: | ||
ifeq (,$(wildcard $(INSTALL_TACKLE_SH))) | ||
@{ \ | ||
@( \ | ||
set -e ;\ | ||
mkdir -p $(dir $(INSTALL_TACKLE_SH)) ;\ | ||
curl -sSLo $(INSTALL_TACKLE_SH) https://raw.githubusercontent.com/konveyor/tackle2-operator/main/hack/install-tackle.sh ;\ | ||
chmod +x $(INSTALL_TACKLE_SH) ;\ | ||
} | ||
) | ||
endif | ||
$(INSTALL_TACKLE_SH); | ||
|
||
|
@@ -142,7 +142,7 @@ test: | |
|
||
# Run Hub REST API tests. | ||
test-api: | ||
HUB_BASE_URL=${HUB_BASE_URL} go test -count=1 -p=1 -v ./test/api/... | ||
HUB_BASE_URL=$(HUB_BASE_URL) go test -count=1 -p=1 -v ./test/api/... | ||
|
||
# Run Hub test suite. | ||
test-all: test-unit test-api | ||
|