-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (57 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
PACKAGE_NAME := build-harness
MAKEFILE_PATH := $(strip $(MAKEFILE_LIST))
MAKEFILE_DIR := $(shell dirname "$(MAKEFILE_PATH)")
SELF = make -f $(MAKEFILE_PATH)
SHELL := /bin/bash
# Formatting codes
green = \x1b[32;01m$1\x1b[0m
yellow = \x1b[33;01m$1\x1b[0m
red = \x1b[33;31m$1\x1b[0m
ifeq ($(strip $(CLUSTER)),)
CLUSTER = $(CLUSTER_NAMESPACE).$(CLUSTER_DOMAIN)
else
TEMP_CLUSTER_PARTS = $(subst ., ,$(CLUSTER))
TEMP_CLUSTER_DOMAIN_PARTS = $(wordlist 2,$(words $(TEMP_CLUSTER_PARTS)), $(TEMP_CLUSTER_PARTS))
CLUSTER_NAMESPACE = $(word 1,$(TEMP_CLUSTER_PARTS))
CLUSTER_DOMAIN = $(word 1,$(TEMP_CLUSTER_DOMAIN_PARTS)).$(word 2,$(TEMP_CLUSTER_DOMAIN_PARTS))
endif
export CLUSTER
export CLUSTER_NAMESPACE
export CLUSTER_DOMAIN
define print
@echo "$@: $1"
endef
# Ensures that a variable is exported
define assert
@[ -n "$$$1" ] || (echo "$(1) not exported in $(@)"; exit 1)
endef
# Ensures that a variable is set
define assert_set
@[ -n "$($1)" ] || (echo "$(1) not set in $(@)"; exit 1)
endef
ifeq ($(CIRCLECI),true)
ifdef CIRCLE_JOB # Circle 2.0
include $(MAKEFILE_DIR)/modules/Makefile.circleci-2.0
else
include $(MAKEFILE_DIR)/modules/Makefile.circleci-1.0
endif
endif
ifdef CF_BUILD_ID # Codefresh
include $(MAKEFILE_DIR)/modules/Makefile.codefresh-1.0
endif
# Include the docker-specific targets
include $(MAKEFILE_DIR)/modules/Makefile.docker
# Include kubernetes deployment targets
include $(MAKEFILE_DIR)/modules/datadog/Makefile
include $(MAKEFILE_DIR)/modules/Makefile.kubernetes
# Include help targets
include $(MAKEFILE_DIR)/modules/Makefile.help
.PHONY : help deps
.DEFAULT_GOAL := help
print-cluster:
@echo "CLUSTER: ${CLUSTER}"
@echo "CLUSTER_NAMESPACE: ${CLUSTER_NAMESPACE}"
@echo "CLUSTER_DOMAIN: ${CLUSTER_DOMAIN}"
# (private) Configure all dependencies
deps::
@exit 0