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

Extract help #738

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/operator/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN apk update && apk add make yq

COPY components/operator/hack components/operator/hack
COPY config/serverless config/serverless
COPY hack/ hack/

RUN make -C components/operator/hack/ci replace-function-chart-images

Expand Down
1 change: 1 addition & 0 deletions components/operator/Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN apk update && apk add make yq

COPY components/operator/hack components/operator/hack
COPY config/serverless config/serverless
COPY hack/ hack/

RUN make -C components/operator/hack/ci replace-only-main-chart-images

Expand Down
1 change: 1 addition & 0 deletions components/operator/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN go mod download

# Copy the go source
COPY components/operator components/operator
COPY hack/ hack/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o operator ./components/operator/main.go
Expand Down
7 changes: 1 addition & 6 deletions components/operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
PROJECT_ROOT = ../..

include ${PROJECT_ROOT}/hack/tools/Makefile
include ${PROJECT_ROOT}/hack/tools/help.Makefile

# incoming variables

Expand All @@ -13,12 +14,6 @@ IMG ?= op-skr-registry.localhost:8888/unsigned/operator-images/serverless-operat
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

##@ General
.DEFAULT_GOAL=help
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

##@ Development
CONFIGOPERATOR = $(PROJECT_ROOT)/config/operator

Expand Down
7 changes: 1 addition & 6 deletions components/operator/hack/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
OPERATOR_ROOT = ../..
PROJECT_ROOT = $(OPERATOR_ROOT)/../..
PROJECT_COMMON = $(OPERATOR_ROOT)/hack/common

##@ General

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
include ${PROJECT_ROOT}/hack/tools/help.Makefile

##@ Tests

Expand Down
6 changes: 0 additions & 6 deletions components/operator/hack/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ OPERATOR_IMAGE_NAME = serverless-operator-dev-local
OPERATOR_IMAGE_TAG = 0.0.0
GARDENER_INFRASTRUCTURE = az

##@ General

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

.PHONY: run
run: ## Create k3d cluster and deploy module.
run: kyma \
Expand Down
8 changes: 2 additions & 6 deletions components/operator/hack/local/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# local variables
PROJECT_COMMON = ../common
PROJECT_LOCAL = ../local

##@ General

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
PROJECT_ROOT = ../../../..
include ${PROJECT_ROOT}/hack/tools/help.Makefile

.PHONY: deploy-k3d
deploy-k3d: ## Build image and deploy operator on a k3d cluster.
Expand Down
7 changes: 1 addition & 6 deletions components/serverless/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
PROJECT_ROOT = ../..

include ${PROJECT_ROOT}/hack/tools/Makefile
include ${PROJECT_ROOT}/hack/tools/help.Makefile

# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

##@ General
.DEFAULT_GOAL=help
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

##@ Verification
.PHONY: test
test: KUBEBUILDER_CONTROLPLANE_START_TIMEOUT=2m
Expand Down
5 changes: 5 additions & 0 deletions hack/tools/help.Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##@ General
.DEFAULT_GOAL=help
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
3 changes: 3 additions & 0 deletions tests/gitserver/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PROJECT_ROOT = ../..
include ${PROJECT_ROOT}/hack/tools/help.Makefile

APP_NAME = gitserver
APP_PATH = tools/$(APP_NAME)
IMG_NAME := $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$(APP_NAME)
Expand Down
3 changes: 3 additions & 0 deletions tests/serverless-bench/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PROJECT_ROOT = ../..
include ${PROJECT_ROOT}/hack/tools/help.Makefile

APP_NAME ?= serverless-bench
APP_VERSION = $(shell date +'%Y%m%d')
TAG = $(APP_VERSION)-$(DOCKER_TAG)
Expand Down
5 changes: 2 additions & 3 deletions tests/serverless/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
PROJECT_ROOT = ../..
include ${PROJECT_ROOT}/hack/tools/help.Makefile

test: ## Run unit test of integration test engine
GO111MODULE=on go test -count=1 -v ./internal/...
Expand Down
Loading