From cbe8a1c3dbbc41ab538fb453a13a7d7b07b96161 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 25 Apr 2022 13:54:42 -0400 Subject: [PATCH] Fix make binaries target to be consistent with rest of Makefile --- Makefile | 11 ++++++++--- debian/build-binaries.sh | 42 ---------------------------------------- 2 files changed, 8 insertions(+), 45 deletions(-) delete mode 100755 debian/build-binaries.sh diff --git a/Makefile b/Makefile index c99c57a..6b47101 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ SHELL := bash -# linux/amd64 linux/arm64 linux/arm/v7 +# linux/amd64,linux/arm64,linux/arm/v7 DOCKER_PLATFORM ?= linux/amd64 DOCKER_OUTPUT ?= --load @@ -34,7 +34,12 @@ docker-gpu: docker buildx build . -f Dockerfile.gpu --tag 'mycroftai/mimic3:gpu' $(DOCKER_OUTPUT) binaries: - rm -rf "dist/$(DOCKER_PLATFORM)" - docker buildx build . -f Dockerfile.binary --platform $(DOCKER_PLATFORM) --output "type=local,dest=dist/$(DOCKER_PLATFORM)" + echo "$(DOCKER_PLATFORM)" | sed -e 's/,/\n/g' | \ + while read -r platform; do \ + echo "$${platform}"; \ + rm -rf "dist/$${platform}"; \ + docker buildx build . -f Dockerfile.binary --platform "$${platform}" --output "type=local,dest=dist/$${platform}"; \ + done debian: + debian/build-debian.sh diff --git a/debian/build-binaries.sh b/debian/build-binaries.sh deleted file mode 100755 index 5168d51..0000000 --- a/debian/build-binaries.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2022 Mycroft AI Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# ----------------------------------------------------------------------------- -# -# Builds PyInstaller binaries for all platforms. -# -set -eo pipefail - -# Directory of *this* script -this_dir="$( cd "$( dirname "$0" )" && pwd )" -src_dir="$(realpath "${this_dir}/..")" - -if [ -z "$1" ]; then - # All platforms - platforms=('linux/amd64' 'linux/arm64' 'linux/arm/v7') -else - # Only platforms from command-line arguments - platforms=("$@") -fi - -pushd "${src_dir}" - -for platform in "${platforms[@]}"; do - DOCKER_PLATFORM="${platform}" \ - make binaries -done - -popd