Skip to content

Commit 76e7532

Browse files
tamilmani1989sharmasushant
authored andcommitted
Added azure-cns as part of azuure-container-networking build (#100)
1 parent 2009917 commit 76e7532

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

Makefile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ CNIFILES = \
2626
$(wildcard cni/network/plugin/*.go) \
2727
$(COREFILES)
2828

29+
CNSFILES = \
30+
$(wildcard cns/*.go) \
31+
$(wildcard cns/common/*.go) \
32+
$(wildcard cni/dockerclient/*.go) \
33+
$(wildcard cni/imdsclient/*.go) \
34+
$(wildcard cni/ipamclient/*.go) \
35+
$(wildcard cni/restserver/*.go) \
36+
$(wildcard cni/routes/*.go) \
37+
$(wildcard cni/service/*.go) \
38+
$(COREFILES) \
39+
$(CNMFILES)
40+
2941
# Build defaults.
3042
GOOS ?= linux
3143
GOARCH ?= amd64
@@ -34,10 +46,12 @@ GOARCH ?= amd64
3446
CNM_DIR = cnm/plugin
3547
CNI_NET_DIR = cni/network/plugin
3648
CNI_IPAM_DIR = cni/ipam/plugin
49+
CNS_DIR = cns/service
3750
OUTPUT_DIR = output
3851
BUILD_DIR = $(OUTPUT_DIR)/$(GOOS)_$(GOARCH)
3952
CNM_BUILD_DIR = $(BUILD_DIR)/cnm
4053
CNI_BUILD_DIR = $(BUILD_DIR)/cni
54+
CNS_BUILD_DIR = $(BUILD_DIR)/cns
4155

4256
# Containerized build parameters.
4357
BUILD_CONTAINER_IMAGE = acn-build
@@ -60,6 +74,7 @@ endif
6074
# Archive file names.
6175
CNM_ARCHIVE_NAME = azure-vnet-cnm-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
6276
CNI_ARCHIVE_NAME = azure-vnet-cni-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
77+
CNS_ARCHIVE_NAME = azure-cns-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
6378

6479
# Docker libnetwork (CNM) plugin v2 image parameters.
6580
CNM_PLUGIN_IMAGE ?= microsoft/azure-vnet-plugin
@@ -74,7 +89,8 @@ azure-cnm-plugin: $(CNM_BUILD_DIR)/azure-vnet-plugin$(EXE_EXT) cnm-archive
7489
azure-vnet: $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT)
7590
azure-vnet-ipam: $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT)
7691
azure-cni-plugin: azure-vnet azure-vnet-ipam cni-archive
77-
all-binaries: azure-cnm-plugin azure-cni-plugin
92+
azure-cns: $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) cns-archive
93+
all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns
7894

7995
# Clean all build artifacts.
8096
.PHONY: clean
@@ -93,6 +109,11 @@ $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT): $(CNIFILES)
93109
$(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT): $(CNIFILES)
94110
go build -v -o $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT) -ldflags "-X main.version=$(VERSION) -s -w" $(CNI_IPAM_DIR)/*.go
95111

112+
# Build the Azure CNS Service.
113+
$(CNS_BUILD_DIR)/azure-cns$(EXE_EXT): $(CNSFILES)
114+
go build -v -o $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) -ldflags "-X main.version=$(VERSION) -s -w" $(CNS_DIR)/*.go
115+
116+
96117
# Build all binaries in a container.
97118
.PHONY: all-binaries-containerized
98119
all-binaries-containerized:
@@ -162,3 +183,10 @@ cnm-archive:
162183
chmod 0755 $(CNM_BUILD_DIR)/azure-vnet-plugin$(EXE_EXT)
163184
cd $(CNM_BUILD_DIR) && $(ARCHIVE_CMD) $(CNM_ARCHIVE_NAME) azure-vnet-plugin$(EXE_EXT)
164185
chown $(BUILD_USER):$(BUILD_USER) $(CNM_BUILD_DIR)/$(CNM_ARCHIVE_NAME)
186+
187+
# Create a CNS archive for the target platform.
188+
.PHONY: cns-archive
189+
cns-archive:
190+
chmod 0755 $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT)
191+
cd $(CNS_BUILD_DIR) && $(ARCHIVE_CMD) $(CNS_ARCHIVE_NAME) azure-cns$(EXE_EXT)
192+
chown $(BUILD_USER):$(BUILD_USER) $(CNS_BUILD_DIR)/$(CNS_ARCHIVE_NAME)

0 commit comments

Comments
 (0)