Skip to content

Commit 28bf6c4

Browse files
TravisEz13msftbot[bot]
authored and
msftbot[bot]
committed
Fix Debian build (#237)
* Fix debian build * remove extra logging
1 parent 52ffcc2 commit 28bf6c4

File tree

5 files changed

+37
-23
lines changed

5 files changed

+37
-23
lines changed

build.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ End {
237237
-Version $windowsVersion `
238238
-ImageName $ImageName `
239239
-LinuxVersion $linuxVersion `
240-
-BaseRepositry $Repository
240+
-BaseRepositry $Repository `
241+
-Strict:$CheckForDuplicateTags.IsPresent
241242

242243
$nameForMessage = Split-Path -Leaf -Path $dockerFileName
243244
$message = "Channel: $nameForMessage does not exist. Not every image exists in every channel. Skipping."
@@ -276,7 +277,9 @@ End {
276277
-LinuxVersion $linuxVersion `
277278
-TagData $allMeta.TagData `
278279
-BaseImage $actualTagData.ActualTags[0] `
279-
-BaseRepositry $Repository
280+
-BaseRepositry $Repository `
281+
-Strict:$CheckForDuplicateTags.IsPresent
282+
280283

281284
$toBuild += $subImageAllMeta
282285
}

release/preview/debian9/getLatestTag.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ $repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath
1111
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags'
1212
Import-Module $modulePath
1313

14-
Get-DockerTags -ShortTags $shortTags -Image "debian" -FullTagFilter 'stretch-\d{8}[\.\d{1}]?-slim' -AlternativeShortTag '9'
14+
Get-DockerTags -ShortTags $shortTags -Image "debian" -FullTagFilter 'stretch-\d{8}[\.\d{1}]?-slim' -AlternativeShortTag '9' -SkipShortTagFilter

release/stable/debian9/getLatestTag.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ $repoRoot = Join-Path -path (Join-Path -Path $parent -ChildPath '..') -ChildPath
1111
$modulePath = Join-Path -Path $repoRoot -ChildPath 'tools\getDockerTags'
1212
Import-Module $modulePath
1313

14-
Get-DockerTags -ShortTags $shortTags -Image "debian" -FullTagFilter 'stretch-\d{8}[\.\d{1}]?-slim' -AlternativeShortTag '9'
14+
Get-DockerTags -ShortTags $shortTags -Image "debian" -FullTagFilter 'stretch-\d{8}[\.\d{1}]?-slim' -AlternativeShortTag '9' -SkipShortTagFilter

tools/buildHelper/buildHelper.psm1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ function Get-DockerImageMetaDataWrapper
370370
$BaseImage,
371371

372372
[string]
373-
$BaseRepositry
373+
$BaseRepositry,
374+
375+
[switch]
376+
$Strict
374377
)
375378

376379
$imagePath = Join-Path -Path $ChannelPath -ChildPath $dockerFileName
@@ -405,6 +408,12 @@ function Get-DockerImageMetaDataWrapper
405408
{
406409
# Get the tag data for the image
407410
$tagDataFromScript = @(& $scriptPath -CI:$CI.IsPresent @getTagsExtraParams | Where-Object {$_.FromTag})
411+
Write-Verbose "tdfs count:$($tagDataFromScript.count)-$($Strict.IsPresent)"
412+
if($tagDataFromScript.count -eq 0 -and $Strict.IsPresent)
413+
{
414+
throw "Did not get tag data from script for $scriptPath!"
415+
}
416+
408417
if($TagFilter)
409418
{
410419
$tagDataFromScript = @($tagDataFromScript | Where-Object { $_.FromTag -match $TagFilter })
@@ -597,7 +606,6 @@ function Get-TestParams
597606
}
598607
}
599608

600-
Write-Verbose "ac: $actualChannel" -Verbose
601609
$testArgs = @{
602610
tags = $actualTagData.ActualTags
603611
BuildArgs = $buildArgs

tools/getDockerTags/getDockerTags.psm1

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,30 +114,33 @@ function Get-DockerTags
114114
Sort-Object -Descending |
115115
Select-Object -First 1
116116

117-
# Return the short form of the tag
118-
$results += [UpstreamDockerTagData] @{
119-
Type = 'Short'
120-
Tag = $shortTag
121-
FromTag = $fullTag
122-
}
123-
124-
if($AlternativeShortTag)
117+
if($fullTag)
125118
{
126119
# Return the short form of the tag
127120
$results += [UpstreamDockerTagData] @{
128121
Type = 'Short'
129-
Tag = $AlternativeShortTag
122+
Tag = $shortTag
130123
FromTag = $fullTag
131124
}
132-
}
133125

134-
if(!$OnlyShortTags.IsPresent)
135-
{
136-
# Return the full form of the tag
137-
$results += [UpstreamDockerTagData] @{
138-
Type = 'Full'
139-
Tag = $fullTag
140-
FromTag = $fullTag
126+
if($AlternativeShortTag)
127+
{
128+
# Return the short form of the tag
129+
$results += [UpstreamDockerTagData] @{
130+
Type = 'Short'
131+
Tag = $AlternativeShortTag
132+
FromTag = $fullTag
133+
}
134+
}
135+
136+
if(!$OnlyShortTags.IsPresent)
137+
{
138+
# Return the full form of the tag
139+
$results += [UpstreamDockerTagData] @{
140+
Type = 'Full'
141+
Tag = $fullTag
142+
FromTag = $fullTag
143+
}
141144
}
142145
}
143146
}

0 commit comments

Comments
 (0)