File tree 4 files changed +27
-36
lines changed
4 files changed +27
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ variables :
2
+ - group : docker-creds
3
+
4
+ jobs :
5
+ - job : Windows
6
+ pool :
7
+ vmImage : win1803
8
+ variables :
9
+ IMAGE_NAME : ' crates-build-env-windows'
10
+ steps :
11
+ - pwsh : ./windows/ci/build.ps1
12
+ displayName : Build Docker image
13
+ - pwsh : ./windows/ci/publish.ps1
14
+ displayName : Publish image to Docker Hub
15
+ condition : |
16
+ and(succeeded(),
17
+ eq(variables['Build.SourceBranch'], 'refs/heads/master'),
18
+ ne(variables['Build.Reason'], 'PullRequest'))
19
+ env :
20
+ DOCKER_PASSWORD : $(DOCKER_PASSWORD)
21
+ DOCKER_USERNAME : $(DOCKER_USERNAME)
Original file line number Diff line number Diff line change 1
- $ErrorActionPreference = " Stop"
2
-
3
- $ContainerBase = ' @sha256:c06b4bfaf634215ea194e6005450740f3a230b27c510cf8facab1e9c678f3a99'
1
+ $ContainerBase = ' :1803'
4
2
5
3
docker build `
6
- - t " $env: PUSH_IMAGE " `
4
+ - t " $env: IMAGE_NAME " `
7
5
-- build-arg " BASE_IMAGE_VER=$ContainerBase " `
8
6
windows
Original file line number Diff line number Diff line change 1
- $ErrorActionPreference = " Stop"
2
-
3
- # Build the image
4
- ./ windows/ ci/ build.ps1
5
-
6
1
foreach ($var in " DOCKER_USERNAME" , " DOCKER_PASSWORD" ) {
7
2
if (-not (Test-Path " env:$var " )) {
8
3
echo " Environment variable \" $var \" not set"
9
4
exit 22
10
5
}
11
6
}
12
7
13
- # Log in to dockerhub
14
- [System.Text.Encoding ]::UTF8.GetString([System.Convert ]::FromBase64String($Env: DOCKER_PASSWORD )).Trim() `
15
- | docker login -- username " $Env: DOCKER_USERNAME " -- password- stdin
16
-
17
- docker push " $env: PUSH_IMAGE "
8
+ Write-Host " Publishing to hub.docker.com/$env: DOCKER_USERNAME "
9
+ docker login -- username " $env: DOCKER_USERNAME " -- password " $env: DOCKER_PASSWORD "
10
+ docker tag " $env: IMAGE_NAME " " $env: DOCKER_USERNAME /$env: IMAGE_NAME "
11
+ docker push " $env: DOCKER_USERNAME /$env: IMAGE_NAME "
You can’t perform that action at this time.
0 commit comments