Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions .pipelines/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,17 @@ stages:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- script: |
GOOS=windows make all-binaries VERSION=$(TAG)
name: "BuildWindows"
displayName: "Build Windows"

- script: |
GOOS=linux make all-binaries VERSION=$(TAG)
name: "BuildLinux"
displayName: "Build Linux"
make all-binaries-platforms VERSION=$(TAG)
name: "BuildAllPlatformBinaries"
displayName: "Build all platform binaries"

- script: |
mkdir -p ./output/bins
cd ./output/linux_amd64
sudo find . -mindepth 2 -type f -regextype posix-extended ! -iregex '.*\.(zip|tgz)$' -delete
sudo find . -mindepth 2 -type f -print -exec mv {} ../bins \;
sudo rm -R -- */ && cd ..
cd ./windows_amd64
sudo find . -mindepth 2 -type f -regextype posix-extended ! -iregex '.*\.(zip|tgz)$' -delete
sudo find . -mindepth 2 -type f -print -exec mv {} ../bins \;
sudo rm -R -- */ && cd ..
rmdir ./linux_amd64 && rmdir ./windows_amd64
cd ./output
find . -name '*.tgz' -print -exec mv -t ./bins/ {} +
find . -name '*.zip' -print -exec mv -t ./bins/ {} +
shopt -s extglob
rm -rf !("bins")
name: "PrepareArtifacts"
displayName: "Prepare Artifacts"

Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL=/bin/bash

# Source files common to all targets.
COREFILES = \
$(wildcard common/*.go) \
Expand Down Expand Up @@ -74,6 +76,8 @@ NPMFILES = \
# Build defaults.
GOOS ?= linux
GOARCH ?= amd64
GOOSES ?= "linux windows" # To override at the cli do: GOOSES="\"darwin bsd\""
GOARCHES ?= "amd64 arm64" # To override at the cli do: GOARCHES="\"ppc64 mips\""

# Build directories.
ROOT_DIR = $(shell pwd)
Expand Down Expand Up @@ -167,6 +171,14 @@ CNS_AI_ID = ce672799-8f08-4235-8c12-08563dc2acef
cnsaipath=github.com/Azure/azure-container-networking/cns/logger.aiMetadata
ENSURE_OUTPUT_DIR_EXISTS := $(shell mkdir -p $(OUTPUT_DIR))

.PHONY: all-binaries-platforms
all-binaries-platforms: ## Make all platform binaries
@for goos in "$(GOOSES)"; do \
for goarch in "$(GOARCHES)"; do \
make all-binaries GOOS=$$goos GOARCH=$$goarch; \
done \
done

# Shorthand target names for convenience.
azure-cnm-plugin: $(CNM_BUILD_DIR)/azure-vnet-plugin$(EXE_EXT) cnm-archive
azure-vnet: $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT)
Expand Down Expand Up @@ -269,12 +281,6 @@ all-containerized:
docker rm $(BUILD_CONTAINER_NAME)
docker rmi $(BUILD_CONTAINER_IMAGE):$(VERSION)

# Make both linux and windows binaries
.PHONY: all-binaries-platforms
all-binaries-platforms:
export GOOS=linux; make all-binaries
export GOOS=windows; make all-binaries


.PHONY: tools
tools: acncli
Expand Down