@cryptotaxi247 / netdata-1 / commits / 1bc0b2692

netdata/packaging/docker/publish: Manifest list naming should take place after version determination (gotcha). Add some extra logging too (#5692)

netdata/packaging/docker/publish: Fix docker publishing

Paul Katsoulakis committed Mar 23, 2019 at 23:31 UTC 1bc0b2692971f27b6b9e36a9e6fc318f63f1e488
1 file changed +7 -1
packaging/docker/publish.sh
+7 -1
@@ -11,7 +11,6 @@ set -e
11 WORKDIR="$(mktemp -d)" # Temporary folder, removed after script is done
12 VERSION="$1"
13 REPOSITORY="${REPOSITORY:-netdata}"
14 -MANIFEST_LIST="${REPOSITORY}:${VERSION}"
14 declare -A ARCH_MAP
15 ARCH_MAP=(["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64")
16 DEVEL_ARCHS=(amd64)
@@ -30,6 +29,7 @@ if [ "${VERSION}" == "" ]; then
29 VERSION="latest"
30 fi
31 fi
32 +MANIFEST_LIST="${REPOSITORY}:${VERSION}"
33
34 # There is no reason to continue if we cannot log in to docker hub
35 if [ -z ${DOCKER_USERNAME+x} ] || [ -z ${DOCKER_PASSWORD+x} ]; then
@@ -70,6 +70,7 @@ echo "Waiting for images publishing to complete"
70 wait
71
72 # Recreate docker manifest list
73 +echo "Creating manifest list.."
74 $DOCKER_CMD manifest create --amend "${MANIFEST_LIST}" \
75 "${MANIFEST_LIST}-i386" \
76 "${MANIFEST_LIST}-armhf" \
@@ -77,15 +78,20 @@ $DOCKER_CMD manifest create --amend "${MANIFEST_LIST}" \
78 "${MANIFEST_LIST}-amd64"
79
80 # Annotate manifest with CPU architecture information
81 +
82 +echo "Executing manifest annotate.."
83 for ARCH in ${ARCHS[@]}; do
84 TAG="${MANIFEST_LIST}-${ARCH}"
85 + echo "Annotating manifest for $ARCH, with TAG: ${TAG} (Manifest list: ${MANIFEST_LIST})"
86 $DOCKER_CMD manifest annotate "${MANIFEST_LIST}" "${TAG}" --os linux --arch "${ARCH_MAP[$ARCH]}"
87 done
88
89 # Push manifest to docker hub
90 +echo "Pushing manifest list to docker.."
91 $DOCKER_CMD manifest push -p "${MANIFEST_LIST}"
92
93 # Show current manifest (debugging purpose only)
94 +echo "Evaluating manifest list entry"
95 $DOCKER_CMD manifest inspect "${MANIFEST_LIST}"
96
97 # Cleanup