Skip to content

Commit 0fd866c

Browse files
Toggle off and on set -x when DOCKER_TOKEN is used (#13293)
* Toggle off and on set -x when DOCKER_TOKEN is used
1 parent fed651b commit 0fd866c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/integrations/manage.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ cmd_publish() {
214214

215215
# log into docker
216216
DOCKER_USERNAME=${DOCKER_USERNAME:-airbytebot}
217+
set +x
217218
DOCKER_TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${DOCKER_USERNAME}'", "password": "'${DOCKER_PASSWORD}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
219+
set -x
218220

219221
echo "image_name $image_name"
220222
echo "versioned_image $versioned_image"
@@ -278,7 +280,9 @@ cmd_publish() {
278280
local arch_versioned_tag=`echo $arch | sed "s/\//-/g"`-$image_version
279281
echo "deleting temporary tag: ${image_name}/tags/${arch_versioned_tag}"
280282
TAG_URL="https://hub.docker.com/v2/repositories/${image_name}/tags/${arch_versioned_tag}/" # trailing slash is needed!
283+
set +x
281284
curl -X DELETE -H "Authorization: JWT ${DOCKER_TOKEN}" "$TAG_URL"
285+
set -x
282286
done
283287

284288
fi
@@ -289,7 +293,9 @@ cmd_publish() {
289293

290294
# To work for private repos we need a token as well
291295
TAG_URL="https://hub.docker.com/v2/repositories/${image_name}/tags/${image_version}"
296+
set +x
292297
DOCKERHUB_RESPONSE_CODE=$(curl --silent --output /dev/null --write-out "%{http_code}" -H "Authorization: JWT ${DOCKER_TOKEN}" ${TAG_URL})
298+
set -x
293299
if [[ "${DOCKERHUB_RESPONSE_CODE}" == "404" ]]; then
294300
echo "Tag ${image_version} was not registered on DockerHub for image ${image_name}, please try to bump the version again." && exit 1
295301
fi

0 commit comments

Comments
 (0)