Skip to content

Commit

Permalink
Using more traditional variable syntax.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Jan 19, 2024
1 parent 2fa215c commit 5084fea
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions Makefile
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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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);

Expand All @@ -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
Expand Down

0 comments on commit 5084fea

Please sign in to comment.