-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
52 lines (42 loc) · 1.79 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PROFILE?=
# Defines the product that the test aims to test
# Since we already have test for RHCOS4, this is the default for now.
PRODUCT?=rhcos4
PLATFORM?=ocp4
CONTENT_IMAGE?=ghcr.io/complianceascode/k8scontent:latest
ROOT_DIR?=
TEST_FLAGS?=-v -timeout 120m
# Should the test attempt to install the operator?
INSTALL_OPERATOR?=true
BYPASS_REMEDIATIONS?=false
GOLANGCI_LINT_VERSION = v1.40.1
BUILD_DIR := build
PLATFORM?=ocp
.PHONY: all
all: e2e
.PHONY: e2e
e2e: ## Run the e2e tests. This requires that the PROFILE and PRODUCT environment variables be set.
## idp_fix.patch is used to fix route destination cert for keycloak IdP deployment
set -o pipefail; go test $(TEST_FLAGS) . -platform="$(PLATFORM)" -profile="$(PROFILE)" -product="$(PRODUCT)" -content-image="$(CONTENT_IMAGE)" -install-operator=$(INSTALL_OPERATOR) -bypass-remediations="$(BYPASS_REMEDIATIONS)" | tee .e2e-test-results.out
.PHONY: help
help: ## Show this help screen
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
@echo ''
@echo 'Available targets are:'
@echo ''
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-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: verify
verify: verify-go-lint ## Run all verification targets
.PHONY: verify-go-lint
verify-go-lint: $(BUILD_DIR)/golangci-lint ## Verify the golang code by linting
$(BUILD_DIR)/golangci-lint run
$(BUILD_DIR)/golangci-lint: $(BUILD_DIR)
export \
VERSION=$(GOLANGCI_LINT_VERSION) \
URL=https://raw.githubusercontent.com/golangci/golangci-lint \
BINDIR=$(BUILD_DIR) && \
curl -sfL $$URL/$$VERSION/install.sh | sh -s $$VERSION
$(BUILD_DIR)/golangci-lint version
$(BUILD_DIR)/golangci-lint linters
$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)