Skip to content
Open
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
10 changes: 7 additions & 3 deletions docker-hook
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ class RequestHandler(BaseHTTPRequestHandler):
env = dict(os.environ)
json_params = {}
if len(json_payload) > 0:
json_params = json.loads(json_payload)
env.update(('REPOSITORY_' + var.upper(), str(val))
for var, val in json_params['repository'].items())
try:
json_params = json.loads(json_payload)
env.update(('REPOSITORY_' + var.upper(), str(val))
for var, val in json_params['repository'].items())
except:
# If not JSON encoded, this is not a problem and should not fail
pass

# Check if the secret URL was called
token = args.token or os.environ.get("DOCKER_AUTH_TOKEN")
Expand Down