-
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.
* login to docker * incorrect env var.. * typo * the folder, not the file * missed some * remember to update evergreen * switch to using a credential helper rather than a credential store * no idea what to use as the default * Revert "no idea what to use as the default" This reverts commit b96be95. * Revert "switch to using a credential helper rather than a credential store" This reverts commit 3ace817. * just remove the env var * bash syntax
- Loading branch information
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
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