-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
121 lines (104 loc) · 3.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Copyright 2024 MNX Cloud, Inc.
#
# The prebuilt sdcnode version we want. See
# "tools/mk/Makefile.node_prebuilt.targ" for details.
NODE_PREBUILT_VERSION=v6.17.1
ifeq ($(shell uname -s),SunOS)
NODE_PREBUILT_TAG=zone64
NODE_PREBUILT_IMAGE=a7199134-7e94-11ec-be67-db6f482136c2
endif
NAME = cloud-load-balancer
DIR_NAME = clb
#
# Tools
#
NODEUNIT := ./node_modules/.bin/nodeunit
#
# Files
#
#JS_FILES := $(shell find lib -name '*.js') parser.js
JS_FILES := parser.js
ESLINT_FILES = $(JS_FILES)
JSSTYLE_FILES = $(JS_FILES)
JSSTYLE_FLAGS = -o indent=4,doxygen,unparenthesized-return=0,leading-right-paren-ok=1
SMF_MANIFESTS = smf/manifests/postboot.xml
ENGBLD_USE_BUILDIMAGE = true
ENGBLD_REQUIRE := $(shell git submodule update --init deps/eng)
include ./deps/eng/tools/mk/Makefile.defs
TOP ?= $(error Unable to access eng.git submodule Makefiles.)
BUILD_PLATFORM = 20210826T002459Z
ifeq ($(shell uname -s),SunOS)
include ./deps/eng/tools/mk/Makefile.node_prebuilt.defs
# include ./deps/eng/tools/mk/Makefile.agent_prebuilt.defs
else
NPM=npm
NODE=node
NPM_EXEC=$(shell which npm)
NODE_EXEC=$(shell which node)
endif
include ./deps/eng/tools/mk/Makefile.smf.defs
ROOT := $(shell pwd)
RELEASE_TARBALL := $(NAME)-pkg-$(STAMP).tar.gz
RELSTAGEDIR := /tmp/$(NAME)-$(STAMP)
#
# Repo-specific targets
#
DEHYDRATED = v1.5.4.1
CLEAN_FILES += bits node_modules dehydrated dehydrated.tar.gz
# triton-origin-x86_64-21.4.0
BASE_IMAGE_UUID = 502eeef2-8267-489f-b19c-a206906f57ef
BUILDIMAGE_NAME = $(NAME)
BUILDIMAGE_DESC = Triton Cloud Load Balancer
BUILDIMAGE_PKGSRC = \
openssl-1.1.1t \
haproxy-2.6.1
dehydrated:
mkdir $@
curl --progress-bar -L -O https://github.com/TritonDataCenter/triton-dehydrated/releases/download/$(DEHYDRATED)/dehydrated.tar.gz
gtar -zxvf dehydrated.tar.gz -C dehydrated
.PHONY: all
all: dehydrated
.PHONY: release
release: all $(NODE_EXEC)
@echo "Building $(RELEASE_TARBALL)"
@mkdir -p $(RELSTAGEDIR)/root/opt/triton/boot
@mkdir -p $(RELSTAGEDIR)/root/opt/triton/$(DIR_NAME)/build
@mkdir -p ${RELSTAGEDIR}/root/opt/triton/tls
@mkdir -p ${RELSTAGEDIR}/root/opt/local/etc/haproxy.cfg
@mkdir -p ${RELSTAGEDIR}/root/opt/custom/smf
@mkdir -p $(RELSTAGEDIR)/site
@touch $(RELSTAGEDIR)/site/.do-not-delete-me
cp -PR $(NODE_INSTALL) $(RELSTAGEDIR)/root/opt/triton/$(DIR_NAME)/build/node
cp -PR $(ROOT)/dehydrated/ $(RELSTAGEDIR)/root/opt/triton/
cp ${ROOT}/dehydrated.cfg ${RELSTAGEDIR}/root/opt/triton/dehydrated/config.overrides
cp ${ROOT}/dehydrated-hook ${RELSTAGEDIR}/root/opt/triton/dehydrated/override-hook
cp ${ROOT}/dhparam.pem ${RELSTAGEDIR}/root/opt/triton/tls
cp -r \
$(ROOT)/reconfigure \
$(ROOT)/parser.js \
$(ROOT)/haproxy.cfg \
$(ROOT)/package.json \
$(RELSTAGEDIR)/root/opt/triton/$(DIR_NAME)/
cp -PR $(ROOT)/smf/* ${RELSTAGEDIR}/root/opt/custom/smf/
cp -PR ${ROOT}/haproxy.cfg/* ${RELSTAGEDIR}/root/opt/local/etc/haproxy.cfg
cp -PR $(ROOT)/boot/* $(RELSTAGEDIR)/root/opt/triton/boot/
(cd $(RELSTAGEDIR) && $(TAR) -I pigz -cf $(ROOT)/$(RELEASE_TARBALL) root site)
@rm -rf $(RELSTAGEDIR)
.PHONY: publish
publish: release
mkdir -p $(ENGBLD_BITS_DIR)/$(NAME)
cp $(ROOT)/$(RELEASE_TARBALL) $(ENGBLD_BITS_DIR)/$(NAME)/$(RELEASE_TARBALL)
include ./deps/eng/tools/mk/Makefile.deps
ifeq ($(shell uname -s),SunOS)
include ./deps/eng/tools/mk/Makefile.node_prebuilt.targ
# include ./deps/eng/tools/mk/Makefile.agent_prebuilt.targ
endif
include ./deps/eng/tools/mk/Makefile.smf.targ
include ./deps/eng/tools/mk/Makefile.targ