Skip to content

Commit

Permalink
[FAB-15673] address shellcheck issues in scripts
Browse files Browse the repository at this point in the history
Change-Id: I132b7ae953cb10c51a94dcd7cfb9f970c5a5642d
Signed-off-by: Matthew Sykes <[email protected]>
  • Loading branch information
sykesm committed Aug 1, 2019
1 parent 580817a commit 5e9ee42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ binaryIncrementalDownload() {
echo "==> Extracting ${BINARY_FILE}..."
tar xzf ./"${BINARY_FILE}" --overwrite
echo "==> Done."
rm -f $"{BINARY_FILE}" "${BINARY_FILE}".md5
rm -f "${BINARY_FILE}" "${BINARY_FILE}".md5
else
echo "Download failed: the local md5sum is different from the remote md5sum. Please try again."
rm -f "${BINARY_FILE}" "${BINARY_FILE}".md5
Expand Down
19 changes: 9 additions & 10 deletions scripts/multiarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ if [ "$#" -ne 2 ]; then
fi

# verify that manifest-tool is installed and found on PATH
which manifest-tool
if [ "$?" -ne 0 ]; then
if ! [ -x "$(command -v manifest-tool)" ]; then
echo "manifest-tool not installed or not found on PATH"
exit 1
fi
Expand All @@ -63,24 +62,24 @@ IMAGES="fabric-baseos fabric-peer fabric-orderer fabric-ccenv fabric-tools"

# check that all images have been published
for image in ${IMAGES}; do
docker pull ${NS_PULL}/${image}:amd64-${VERSION} || missing
docker pull ${NS_PULL}/${image}:s390x-${VERSION} || missing
docker pull "${NS_PULL}/${image}:amd64-${VERSION}" || missing
docker pull "${NS_PULL}/${image}:s390x-${VERSION}" || missing
done

# push the multiarch manifest and tag with just $VERSION
for image in ${IMAGES}; do
manifest-tool --username ${USER} --password ${PASSWORD} push from-args\
--platforms linux/amd64,linux/s390x --template "${NS_PULL}/${image}:ARCH-${VERSION}"\
manifest-tool --username "${USER}" --password "${PASSWORD}" push from-args \
--platforms linux/amd64,linux/s390x --template "${NS_PULL}/${image}:ARCH-${VERSION}" \
--target "${NS_PUSH}/${image}:${VERSION}"
manifest-tool --username ${USER} --password ${PASSWORD} push from-args\
--platforms linux/amd64,linux/s390x --template "${NS_PULL}/${image}:ARCH-${VERSION}"\
manifest-tool --username "${USER}" --password "${PASSWORD}" push from-args \
--platforms linux/amd64,linux/s390x --template "${NS_PULL}/${image}:ARCH-${VERSION}" \
--target "${NS_PUSH}/${image}:${TWO_DIGIT_VERSION}"
done

# test that manifest is working as expected
for image in ${IMAGES}; do
docker pull ${NS_PULL}/${image}:${VERSION} || failed
docker pull ${NS_PULL}/${image}:${TWO_DIGIT_VERSION} || failed
docker pull "${NS_PULL}/${image}:${VERSION}" || failed
docker pull "${NS_PULL}/${image}:${TWO_DIGIT_VERSION}" || failed
done

echo "Successfully pushed multiarch manifest"
Expand Down

0 comments on commit 5e9ee42

Please sign in to comment.