Skip to content

Commit

Permalink
update: pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Downs <[email protected]>
  • Loading branch information
briandowns committed Sep 18, 2023
1 parent 5776d62 commit 3d108d0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/rancher_image_chart_promote.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,28 @@ until [ ${PAGE} -gt 100 ]; do
echo "finding build number for tag: ${SOURCE_TAG}"

BUILD_NUMBER=$(drone build ls rancher/rancher --page ${PAGE} --event tag --format "{{.Number}},{{.Ref}}"| grep "${SOURCE_TAG}"$ |cut -d',' -f1|head -1)
if [ ! -n "${BUILD_NUMBER}" ]; then
echo "error: no build found for tag: ${SOURCE_TAG}"
exit 1
if [ -n "${BUILD_NUMBER}" ]; then
break
fi

PAGE=$((PAGE+1))

sleep 1
done

if [ ! -n "${BUILD_NUMBER}" ]; then
echo "error: no build found for tag: ${SOURCE_TAG}"
exit 1
fi

echo "Found build number ${BUILD_NUMBER} for tag ${SOURCE_TAG}"
if [ "${DRY_RUN}" = true ]; then
CMD="drone build promote rancher/rancher ${BUILD_NUMBER} promote-docker-image --param=SOURCE_TAG=${SOURCE_TAG} --param=DESTINATION_TAG=${DESTINATION_TAG}"
echo "${CMD}"
else
drone build promote rancher/rancher "${BUILD_NUMBER} promote-docker-image --param=SOURCE_TAG=${SOURCE_TAG} --param=DESTINATION_TAG=${DESTINATION_TAG}"
BUILD_NUMBER=""
sleep 2
fi

echo "promoting Chart${SOURCE_TAG} to ${DESTINATION_TAG}"
Expand Down

0 comments on commit 3d108d0

Please sign in to comment.