summaryrefslogtreecommitdiffstats
path: root/packaging/docker/build-test.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:57:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:57:13 +0000
commitcbf70980c060bde02906a8e9de2064459bacc93c (patch)
tree5b9ade02e0ed32a4b33f5e8647092d0c02ea586d /packaging/docker/build-test.sh
parentReleasing debian version 1.16.0-1. (diff)
downloadnetdata-cbf70980c060bde02906a8e9de2064459bacc93c.tar.xz
netdata-cbf70980c060bde02906a8e9de2064459bacc93c.zip
Merging upstream version 1.16.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/docker/build-test.sh')
-rwxr-xr-xpackaging/docker/build-test.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/packaging/docker/build-test.sh b/packaging/docker/build-test.sh
index a7e31d4f4..3c55e1736 100755
--- a/packaging/docker/build-test.sh
+++ b/packaging/docker/build-test.sh
@@ -46,27 +46,29 @@ do
esac
done
-if [ -n "${REPOSITORY}" ] && [ -n "${VERSION}" ] && [ -n "${DOCKER_USERNAME}" ] && [ -n "${DOCKER_PWD}" ] ; then
+if [ -n "${REPOSITORY}" ]; then
if [ $DOBUILD -eq 1 ] ; then
- echo "Building ${VERSION} of ${REPOSITORY} container"
+ echo "Building ${VERSION:-latest} of ${REPOSITORY} container"
docker run --rm --privileged multiarch/qemu-user-static:register --reset
# Build images using multi-arch Dockerfile.
- eval docker build --build-arg ARCH="amd64" --tag "${REPOSITORY}:${VERSION}" --file packaging/docker/Dockerfile ./
+ eval docker build --build-arg ARCH="amd64" --tag "${REPOSITORY}:${VERSION:-latest}" --file packaging/docker/Dockerfile ./
# Create temporary docker CLI config with experimental features enabled (manifests v2 need it)
mkdir -p /tmp/docker
#echo '{"experimental":"enabled"}' > /tmp/docker/config.json
fi
- # Login to docker hub to allow futher operations
- echo "Logging into docker"
- echo "$DOCKER_PWD" | docker --config /tmp/docker login -u "$DOCKER_USERNAME" --password-stdin
+ if [ -n "${DOCKER_USERNAME}" ] && [ -n "${DOCKER_PWD}" ] ; then
+ # Login to docker hub to allow futher operations
+ echo "Logging into docker"
+ echo "$DOCKER_PWD" | docker --config /tmp/docker login -u "$DOCKER_USERNAME" --password-stdin
- echo "Pushing ${REPOSITORY}:${VERSION}"
- docker --config /tmp/docker push "${REPOSITORY}:${VERSION}"
+ echo "Pushing ${REPOSITORY}:${VERSION}"
+ docker --config /tmp/docker push "${REPOSITORY}:${VERSION}"
+ fi
else
- echo "Missing parameter. REPOSITORY=${REPOSITORY} VERSION=${VERSION} DOCKER_USERNAME=${DOCKER_USERNAME} DOCKER_PWD=${DOCKER_PWD}"
+ echo "Missing parameter. REPOSITORY=${REPOSITORY}"
printhelp
exit 1
fi