@@ -88,6 +88,7 @@ CNM_ARCHIVE_NAME = azure-vnet-cnm-$(GOOS)-$(GOARCH)-$(VERSION).$(ARCHIVE_EXT)
8888CNI_ARCHIVE_NAME = azure-vnet-cni-$(GOOS ) -$(GOARCH ) -$(VERSION ) .$(ARCHIVE_EXT )
8989CNI_MULTITENANCY_ARCHIVE_NAME = azure-vnet-cni-multitenancy-$(GOOS ) -$(GOARCH ) -$(VERSION ) .$(ARCHIVE_EXT )
9090CNS_ARCHIVE_NAME = azure-cns-$(GOOS ) -$(GOARCH ) -$(VERSION ) .$(ARCHIVE_EXT )
91+ NPM_ARCHIVE_NAME = azure-npm-$(GOOS ) -$(GOARCH ) -$(VERSION ) .$(ARCHIVE_EXT )
9192
9293# Docker libnetwork (CNM) plugin v2 image parameters.
9394CNM_PLUGIN_IMAGE ?= microsoft/azure-vnet-plugin
@@ -107,7 +108,7 @@ azure-vnet: $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT)
107108azure-vnet-ipam : $(CNI_BUILD_DIR ) /azure-vnet-ipam$(EXE_EXT )
108109azure-cni-plugin : azure-vnet azure-vnet-ipam cni-archive
109110azure-cns : $(CNS_BUILD_DIR ) /azure-cns$(EXE_EXT ) cns-archive
110- azure-npm : $(NPM_BUILD_DIR ) /azure-npm
111+ azure-npm : $(NPM_BUILD_DIR ) /azure-npm$( EXE_EXT ) npm-archive
111112
112113all-binaries : azure-cnm-plugin azure-cni-plugin azure-cns azure-npm
113114
@@ -232,4 +233,14 @@ cnm-archive:
232233cns-archive :
233234 chmod 0755 $(CNS_BUILD_DIR ) /azure-cns$(EXE_EXT )
234235 cd $(CNS_BUILD_DIR ) && $(ARCHIVE_CMD ) $(CNS_ARCHIVE_NAME ) azure-cns$(EXE_EXT )
235- chown $(BUILD_USER ) :$(BUILD_USER ) $(CNS_BUILD_DIR ) /$(CNS_ARCHIVE_NAME )
236+ chown $(BUILD_USER ) :$(BUILD_USER ) $(CNS_BUILD_DIR ) /$(CNS_ARCHIVE_NAME )
237+
238+ # Create a NPM archive for the target platform.
239+ .PHONY : npm-archive
240+ npm-archive :
241+ ifeq ($(GOOS ) ,linux)
242+ # Azure-NPM only supports Linux for now.
243+ chmod 0755 $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT)
244+ cd $(NPM_BUILD_DIR) && $(ARCHIVE_CMD) $(NPM_ARCHIVE_NAME) azure-npm$(EXE_EXT)
245+ chown $(BUILD_USER):$(BUILD_USER) $(NPM_BUILD_DIR)/$(NPM_ARCHIVE_NAME)
246+ endif
0 commit comments