-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
90 lines (72 loc) · 3.96 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
85
86
87
88
89
90
# Project Setup
PROJECT_NAME := configuration-caas
PROJECT_REPO := github.com/upbound/$(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.24.1
UP_CHANNEL = stable
UPTEST_VERSION = v0.11.0
-include build/makelib/k8s_tools.mk
# ====================================================================================
# Setup XPKG
# NOTE(jastang): Configurations deployed in Upbound do not currently follow
# certain conventions such as the default examples root or package directory.
XPKG_DIR = $(shell pwd)
XPKG_EXAMPLES_DIR = .up/examples
XPKG_IGNORE = .github/workflows/*.yml,.github/workflows/*.yaml,init/*.yaml,examples/flux/*.yaml,examples/*.yaml,examples/argocd/*.yaml,.work/uptest-datasource.yaml
XPKG_REG_ORGS ?= xpkg.upbound.io/upbound
# NOTE(hasheddan): skip promoting on xpkg.upbound.io as channel tags are
# inferred.
XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/upbound
XPKGS = $(PROJECT_NAME)
-include build/makelib/xpkg.mk
CROSSPLANE_NAMESPACE = upbound-system
CROSSPLANE_ARGS = "--enable-usages"
-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:
# $ export UPTEST_CLOUD_CREDENTIALS=$(echo "AWS='$(cat ~/.aws/credentials)'\nAZURE='$(cat ~/.azure/credentials.json)'\nGCP='$(cat ~/.gcloud/credentials.json)")
uptest: $(UPTEST) $(KUBECTL) $(KUTTL)
@$(INFO) running automated tests
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) CROSSPLANE_NAMESPACE=$(CROSSPLANE_NAMESPACE) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --data-source="${UPTEST_DATASOURCE_PATH}" --setup-script=test/setup.sh --default-timeout=4800 || $(FAIL)
@$(OK) running automated tests
# This target requires the following environment variables to be set:
# $ export UPTEST_CLOUD_CREDENTIALS=$(echo "AWS='$(cat ~/.aws/credentials)'\nAZURE='$(cat ~/.azure/credentials.json)'\nGCP='$(cat ~/.gcloud/credentials.json)")
e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest
render:
crossplane beta render examples/flux/aws-cluster.yaml apis/composition.yaml examples/functions.yaml -r
crossplane beta render examples/flux/gcp-cluster.yaml apis/composition.yaml examples/functions.yaml -r
crossplane beta render examples/flux/azure-cluster.yaml apis/composition.yaml examples/functions.yaml -r
crossplane beta render examples/argocd/aws-cluster.yaml apis/composition.yaml examples/functions.yaml -r
crossplane beta render examples/argocd/gcp-cluster.yaml apis/composition.yaml examples/functions.yaml -r
crossplane beta render examples/argocd/azure-cluster.yaml apis/composition.yaml examples/functions.yaml -r
yamllint:
@$(INFO) running yamllint
@yamllint ./apis || $(FAIL)
@$(OK) running yamllint
.PHONY: uptest e2e render yamllint