forked from upbound/xgql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (55 loc) · 1.95 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
# Setup Project
PROJECT_NAME := xgql
PROJECT_REPO := github.com/upbound/$(PROJECT_NAME)
PLATFORMS ?= linux_amd64 linux_arm64
-include build/makelib/common.mk
# Setup Output
-include build/makelib/output.mk
# Setup Go
NPROCS ?= 1
GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 )))
GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/${PROJECT_NAME}
GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION)
GO_SUBDIRS += cmd internal
GO111MODULE = on
-include build/makelib/golang.mk
# Setup Node (for linting the schema)
YARN_DIR = lint-schema
-include build/makelib/yarnjs.mk
# Setup Helm
USE_HELM3 = true
HELM_BASE_URL = https://charts.upbound.io
HELM_S3_BUCKET = upbound.charts
HELM_CHARTS = xgql
HELM_CHART_LINT_ARGS_xgql = --set nameOverride='',imagePullSecrets=''
-include build/makelib/k8s_tools.mk
-include build/makelib/helm.mk
# Setup Images
DOCKER_REGISTRY = upbound
IMAGES = xgql
OSBASEIMAGE = gcr.io/distroless/static:nonroot
-include build/makelib/image.mk
fallthrough: submodules
@echo Initial setup complete. Running make again . . .
@make
yarn.lint: yarn.install
@cd $(YARN_DIR); $(YARN) format
@cd $(YARN_DIR); $(YARN) lint
# Update the submodules, such as the common build scripts.
submodules:
@git submodule sync
@git submodule update --init --recursive
.PHONY: submodules fallthrough
# ====================================================================================
# Special Targets
define XGQL_MAKE_HELP
xgql Targets:
submodules Update the submodules, such as the common build scripts.
endef
# The reason XGQL_MAKE_HELP is used instead of XGQL_HELP is because the xgql
# binary will try to use XGQL_HELP if it is set, and this is for something different.
export XGQL_MAKE_HELP
xgql.help:
@echo "$$XGQL_MAKE_HELP"
help-special: xgql.help
.PHONY: xgql.help help-special