-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (68 loc) · 3.42 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Project Setup
PROJECT_NAME := platform-ref-castai
PROJECT_REPO := github.com/haarchri/$(PROJECT_NAME)
# NOTE(hasheddan): the platform is insignificant here as Configuration package
# images are not architecture-specific. We constrain to one platform to avoid
# needlessly pushing a multi-arch image.
PLATFORMS ?= linux_amd64
-include build/makelib/common.mk
# ====================================================================================
# Setup Kubernetes tools
UP_VERSION = v0.16.1
UP_CHANNEL = stable
UPTEST_VERSION = v0.5.0
UPTEST_CLAIMS = examples/XFullAccess.yaml,examples/XReadOnly.yaml
# ====================================================================================
# Setup Helm
USE_HELM3 = true
HELM3_VERSION = v3.11.2
HELM_OCI_URL = xpkg.upbound.io/upbound
HELM_CHARTS = $(PROJECT_NAME)-chart
HELM_CHART_LINT_ARGS_$(PROJECT_NAME) = --set nameOverride='',imagePullSecrets=''
HELM_CHARTS_DIR ?= $(ROOT_DIR)/chart
-include build/makelib/k8s_tools.mk
# -include makelib/helmoci.mk
# ====================================================================================
# Setup XPKG
XPKG_REG_ORGS ?= xpkg.upbound.io/haarchri
# NOTE(hasheddan): skip promoting on xpkg.upbound.io as channel tags are
# inferred.
XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/haarchri
XPKGS = $(PROJECT_NAME)
XPKG_DIR := $(ROOT_DIR)/apis
-include build/makelib/xpkg.mk
CROSSPLANE_NAMESPACE = crossplane-system
-include build/makelib/local.xpkg.mk
-include build/makelib/controlplane.mk
# ====================================================================================
# Targets
# run `make help` to see the targets and options
# We want submodules to be set up the first time `make` is run.
# We manage the build/ folder and its Makefiles as a submodule.
# The first time `make` is run, the includes of build/*.mk files will
# all fail, and this target will be run. The next time, the default as defined
# by the includes will be run instead.
fallthrough: submodules
@echo Initial setup complete. Running make again . . .
@make
# Update the submodules, such as the common build scripts.
submodules:
@git submodule sync
@git submodule update --init --recursive
# We must ensure up is installed in tool cache prior to build as including the k8s_tools machinery prior to the xpkg
# machinery sets UP to point to tool cache.
build.init: $(UP)
# ====================================================================================
# End to End Testing
# This target requires the following environment variables to be set:
# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials)
# - CASTAI_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export CASTAI_CLOUD_CREDENTIALS=$(cat ./castai.json)
uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
@$(INFO) running automated tests
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e $(UPTEST_CLAIMS) --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL)
@$(OK) running automated tests
# This target requires the following environment variables to be set:
# - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials)
# - CASTAI_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export CASTAI_CLOUD_CREDENTIALS=$(cat ./castai.json)
e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest
.PHONY: uptest e2e