Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ End {
foreach ($tagGroup in $allMeta.ActualTagDataByGroup.Keys)
{
$actualTagData = $allMeta.ActualTagDataByGroup.$tagGroup
Write-Verbose -Message "getting subimage: $tagGroup $($allMeta.Meta.SubImage)" -Verbose
Write-Verbose -Message "getting subimage - fromtag: $($tagGroup.Name) - subimage: $($allMeta.Meta.SubImage)"
$SubImagePath = Join-Path -Path $dockerFileName -ChildPath $allMeta.Meta.SubImage

$subImageAllMeta = Get-DockerImageMetaDataWrapper `
Expand Down Expand Up @@ -332,14 +332,17 @@ End {
}
}
elseif ($GenerateTagsYaml.IsPresent) {
$tagGroup = 'public/powershell'
$tagGroup = "public/$($allMeta.FullRepository)"
$os = 'windows'
if($allMeta.meta.IsLinux)
{
$os = 'linux'
}
$architecture = 'amd64'
$dockerfile = "https://github.com/PowerShell/PowerShell-Docker/blob/master/release/$actualChannel/$dockerFileName/docker/Dockerfile"
$imagePath = $allMeta.imagePath
$relativeImagePath = $imagePath -replace $PSScriptRoot
$relativeImagePath = $relativeImagePath -replace '\\', '/'
$dockerfile = "https://github.com/PowerShell/PowerShell-Docker/blob/master$relativeImagePath/docker/Dockerfile"

$osVersion = $allMeta.meta.osVersion
if($osVersion)
Expand Down
2 changes: 1 addition & 1 deletion release/stable/centos7/test-deps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ARG PS_VERSION=6.2.0

LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
description="This Dockerfile will install the latest release of PowerShell." \
description="This Dockerfile will install the latest release of PowerShell and tools needed for runing CI/CD container jobs." \
org.label-schema.usage="https://github.com/PowerShell/PowerShell/tree/master/docker#run-the-docker-image-you-built" \
org.label-schema.url="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md" \
org.label-schema.vcs-url="https://github.com/PowerShell/PowerShell-Docker" \
Expand Down
13 changes: 8 additions & 5 deletions tests/containerTestCommon.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function Invoke-DockerBuild
$buildArgList += @(
'-r'
$env:ACR_NAME
'--os'
'--platform'
$OSType
)
}
Expand All @@ -457,10 +457,13 @@ function Invoke-DockerBuild
throw "$argName contains '&' and this is not allowed in ACR using the az cli"
}

$buildArgList += @(
"--build-arg"
"$argName=$value"
)
if($value)
{
$buildArgList += @(
"--build-arg"
"$argName=$value"
)
}
}

foreach($tag in $Tags)
Expand Down
7 changes: 4 additions & 3 deletions tools/buildHelper/buildHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Gets the Current version of PowerShell from the PowerShell repo
# or formats the version based on the parameters

function Get-PowerShellVersion
{
[CmdletBinding(DefaultParameterSetName='Default')]
Expand Down Expand Up @@ -323,7 +324,7 @@ class DockerImageFullMetaData
[string] $ImagePath
# this is UpstreamDockerTagData[]
[object[]] $TagData
[System.Collections.Generic.Dictionary[string,TagData]] $ActualTagDataByGroup
[System.Collections.Generic.Dictionary[object,TagData]] $ActualTagDataByGroup
[string] $PSVersion
[string] $BaseImage
[string] $FullRepository
Expand Down Expand Up @@ -424,7 +425,7 @@ function Get-DockerImageMetaDataWrapper
}
}

$actualTagDataByGroup = [System.Collections.Generic.Dictionary[string,TagData]]::new()
$actualTagDataByGroup = [System.Collections.Generic.Dictionary[object,TagData]]::new()
foreach ($tagGroup in ($tagDataFromScript | Group-Object -Property 'FromTag'))
{
$actualTagDataByGroup[$tagGroup] = Get-TagData -TagsTemplates $tagsTemplates -TagGroup $tagGroup -Version $Version -ImageName $ImageName -Repository $fullRepository
Expand Down Expand Up @@ -614,7 +615,7 @@ function Get-TagData
param(
[string[]]
$TagsTemplates,
[Microsoft.PowerShell.Commands.GroupInfo]
[object]
$TagGroup,
[string]
$Version,
Expand Down
4 changes: 2 additions & 2 deletions vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
vmImage: ubuntu-16.04
displayName: Check For Duplicate Tags
steps:
- powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))"
- pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))"
displayName: Set Build Name for Non-PR
condition: ne(variables['Build.Reason'], 'PullRequest')

- powershell: ./build.ps1 -CheckForDuplicateTags -Channel stable, preview, servicing
- pwsh: ./build.ps1 -CheckForDuplicateTags -Channel stable, preview, servicing
displayName: Check for Duplicate Tags
condition: succeededOrFailed()

Expand Down