Created
March 29, 2017 09:52
-
-
Save rcmorano/e51935a2c1427c98c91757f33a71ab0b to your computer and use it in GitHub Desktop.
expect script to interact with "docker login"
This file contains hidden or 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
#!/bin/bash | |
#DOCKER_REGISTRY_URI=_DOCKER_REGISTRY_URI_ | |
#DOCKER_REGISTRY_USER=_DOCKER_REGISTRY_USER_ | |
#DOCKER_REGISTRY_PASS=_DOCKER_REGISTRY_PASS_ | |
expect <<EOF | |
spawn docker login -u $DOCKER_REGISTRY_USER $DOCKER_REGISTRY_URI | |
while (1) { | |
expect { | |
-re ".*Password:.*" { send "$DOCKER_REGISTRY_PASS\r" } | |
eof { break } | |
} | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment