File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -155,10 +155,11 @@ jobs:
155
155
SENTRY_PROJECT : airbyte-connectors
156
156
- name : Publish ${{ github.event.inputs.connector }}
157
157
run : |
158
- echo "$SPEC_CACHE_SERVICE_ACCOUNT_KEY" > spec_cache_key_file.json && docker login -u airbytebot -p ${DOCKER_PASSWORD}
158
+ echo "$SPEC_CACHE_SERVICE_ACCOUNT_KEY" > spec_cache_key_file.json && docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
159
159
./tools/integrations/manage.sh publish airbyte-integrations/${{ github.event.inputs.connector }} ${{ github.event.inputs.run-tests }} --publish_spec_to_cache
160
160
id : publish
161
161
env :
162
+ DOCKER_USERNAME : airbytebot
162
163
DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
163
164
# Oracle expects this variable to be set. Although usually present, this is not set by default on Github virtual runners.
164
165
TZ : UTC
Original file line number Diff line number Diff line change @@ -229,12 +229,16 @@ cmd_publish() {
229
229
docker push " $versioned_image "
230
230
docker push " $latest_image "
231
231
fi
232
-
232
+
233
233
# Checking if the image was successfully registered on DockerHub
234
234
# see the description of this PR to understand why this is needed https://github.com/airbytehq/airbyte/pull/11654/
235
235
sleep 5
236
+
237
+ # To work for private repos we need a token as well
238
+ DOCKER_USERNAME=${DOCKER_USERNAME:- airbytebot}
239
+ 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)
236
240
TAG_URL=" https://hub.docker.com/v2/repositories/${image_name} /tags/${image_version} "
237
- DOCKERHUB_RESPONSE_CODE=$( curl --silent --output /dev/null --write-out " %{http_code}" ${TAG_URL} )
241
+ DOCKERHUB_RESPONSE_CODE=$( curl --silent --output /dev/null --write-out " %{http_code}" -H " Authorization: JWT ${DOCKER_TOKEN} " ${TAG_URL} )
238
242
if [[ " ${DOCKERHUB_RESPONSE_CODE} " == " 404" ]]; then
239
243
echo " Tag ${image_version} was not registered on DockerHub for image ${image_name} , please try to bump the version again." && exit 1
240
244
fi
You can’t perform that action at this time.
0 commit comments