Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/build/Makefile.docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ promote_image: $(HOME)/.docker/cli-plugins/docker-buildx

# update dockerhub README
[ -s /usr/bin/jq ] || apk add jq
@JSON=$(jq -n --arg pwd "$DOCKER_TOKEN" --arg user "$USER_LOGIN" \
@JSON=$$(jq -n --arg pwd "$(DOCKER_TOKEN)" --arg user "$(USER_LOGIN)" \
'{username: $user, password: $pwd}')
@JWT=$(curl -s -H "Content-Type: application/json" -X POST \
-d "$JSON" https://hub.docker.com/v2/users/login/ |jq -r .token)
@JWT=$$(curl -s -H "Content-Type: application/json" -X POST \
-d "$$JSON" https://hub.docker.com/v2/users/login/ |jq -r .token)
# Build JSON payload securely and send PATCH request
# jq --arg escapes special characters / newlines in markdown text
RESP=$(jq -n --arg desc "$(<README.md)" '{"full_description": $desc}' | \
RESP=$$(jq -n --arg desc "$(<README.md)" '{"full_description": $desc}' | \
curl -s -o /dev/null -w "%{http_code}" -X PATCH \
-H "Content-Type: application/json" \
-H "Authorization: JWT $JWT_TOKEN" \
-H "Authorization: JWT $$JWT" \
-d @- https://hub.docker.com/v2/repositories/$(IMAGE_REPO)/
[ "$RESPONSE_CODE" -eq 200 ] || exit 1
[ "$$RESP" -eq 200 ] || exit 1

flake8: test_requirements
@echo "Running flake8 code analysis"
Expand Down
Loading