-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
5,819 additions
and
6,835 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
DOCKER_HUB_URL="https://index.docker.io/v1/" | ||
|
||
STDIN=$(cat) | ||
|
||
ACTION="$1" | ||
|
||
case "$ACTION" in | ||
get) | ||
SERVER_URL="$STDIN" | ||
|
||
if [[ "$SERVER_URL" == "$DOCKER_HUB_URL" ]]; then | ||
if [[ -z "${DOCKERHUB_USERNAME:-}" || -z "${DOCKERHUB_PASSWORD:-}" ]]; then | ||
echo "Error: DOCKERHUB_USERNAME or DOCKERHUB_PASSWORD environment variables are not set." >&2 | ||
exit 1 | ||
fi | ||
|
||
echo "{\"Username\": \"$DOCKERHUB_USERNAME\", \"Secret\": \"$DOCKERHUB_PASSWORD\"}" | ||
else | ||
echo "Error: No credentials available for $SERVER_URL" >&2 | ||
exit 1 | ||
fi | ||
;; | ||
|
||
*) | ||
echo "Unsupported action: $ACTION" >&2 | ||
exit 1 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"auths": { | ||
"https://index.docker.io/v1/": {} | ||
}, | ||
"credsStore": "from-env" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.