|
@@ -1,4 +1,4 @@
|
|
|
-#!/bin/bash
|
|
|
+#!/usr/bin/env bash
|
|
|
# Cross-arch docker build helper script
|
|
|
#
|
|
|
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
|
@@ -14,12 +14,21 @@ if [ "${BASH_VERSINFO[0]}" -lt "4" ]; then
|
|
|
fi
|
|
|
|
|
|
VERSION="$1"
|
|
|
-REPOSITORY="${REPOSITORY:-netdata}"
|
|
|
declare -A ARCH_MAP
|
|
|
ARCH_MAP=(["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64")
|
|
|
DEVEL_ARCHS=(amd64)
|
|
|
ARCHS="${!ARCH_MAP[@]}"
|
|
|
|
|
|
+if [ -z ${REPOSITORY} ]; then
|
|
|
+ REPOSITORY="${TRAVIS_REPO_SLUG}"
|
|
|
+ if [ -z ${REPOSITORY} ]; then
|
|
|
+ echo "REPOSITORY not set, build cannot proceed"
|
|
|
+ exit 1
|
|
|
+ else
|
|
|
+ echo "REPOSITORY was not detected, attempted to use TRAVIS_REPO_SLUG setting: ${TRAVIS_REPO_SLUG}"
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
# When development mode is set, build on DEVEL_ARCHS
|
|
|
if [ ! -z ${DEVEL+x} ]; then
|
|
|
declare -a ARCHS=(${DEVEL_ARCHS[@]})
|
|
@@ -53,7 +62,7 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
|
|
for ARCH in ${ARCHS[@]}; do
|
|
|
TAG="${REPOSITORY}:${VERSION}-${ARCH}"
|
|
|
echo "Building tag ${TAG}.."
|
|
|
- eval docker build \
|
|
|
+ eval docker build --no-cache \
|
|
|
--build-arg ARCH="${ARCH}" \
|
|
|
--tag "${TAG}" \
|
|
|
--file packaging/docker/Dockerfile ./
|