Skip to content

Commit

Permalink
Merge pull request rust-lang#8 from ecstatic-morse/windows-check-env
Browse files Browse the repository at this point in the history
Ensure "DOCKER_{PASSWORD,USERNAME}" are set prior to deployment on AppVeyor
  • Loading branch information
pietroalbini authored Feb 20, 2019
2 parents 6c76fb2 + 82abbdf commit fe1bd41
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions windows/ci/publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ $ErrorActionPreference = "Stop"
# Build the image
./windows/ci/build.ps1

foreach ($var in "DOCKER_USERNAME", "DOCKER_PASSWORD") {
if (-not (Test-Path "env:$var")) {
echo "Environment variable \"$var\" not set"
exit 22
}
}

# Log in to dockerhub
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Env:DOCKER_PASSWORD)).Trim() `
| docker login --username "$Env:DOCKER_USERNAME" --password-stdin
Expand Down

0 comments on commit fe1bd41

Please sign in to comment.