Skip to content

Commit

Permalink
next major second fix (#3363)
Browse files Browse the repository at this point in the history
Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk authored Feb 23, 2024
1 parent 9941b36 commit 7b29e4c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions AppHandling/Compile-AppInNavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ try {
Write-Host "Processing dependency $($dependency.Publisher)_$($dependency.Name)_$($dependency.Version) ($($dependency.AppId))"
$existingApp = $existingApps | Where-Object {
if ($platformversion -ge [System.Version]"19.0.0.0") {
((($dependency.appId -ne '' -and $_.AppId -eq $dependency.appId) -or ($dependency.appId -eq '' -and $_.Name -eq $dependency.Name)) -and ([System.Version]$_.Version -ge [System.Version]$dependency.version))
((($dependency.appId -ne '' -and $_.AppId.value.ToString() -eq $dependency.appId) -or ($dependency.appId -eq '' -and $_.Name -eq $dependency.Name)) -and ([System.Version]$_.Version -ge [System.Version]$dependency.version))
}
else {
(($_.Name -eq $dependency.name) -and ($_.Name -eq "Application" -or (($_.Publisher -eq $dependency.publisher) -and ([System.Version]$_.Version -ge [System.Version]$dependency.version))))
Expand Down Expand Up @@ -606,7 +606,7 @@ try {
$dependency = $_
$dependencyAppId = "$(if ($dependency.PSObject.Properties.name -eq 'AppId') { $dependency.AppId } else { $dependency.Id })"
Write-Host "Dependency: Id=$dependencyAppId, Publisher=$($dependency.Publisher), Name=$($dependency.Name), Version=$($dependency.Version)"
$existingApps | Where-Object { $_.AppId -eq [System.Guid]$dependencyAppId -and $_.Version -gt [System.Version]$dependency.Version } | ForEach-Object {
$existingApps | Where-Object { "$($_.AppId)" -eq $dependencyAppId -and $_.Version -gt [System.Version]$dependency.Version } | ForEach-Object {
$dependency.Version = "$($_.Version)"
Write-Host "- Set dependency version to $($_.Version)"
$changes = $true
Expand Down
2 changes: 1 addition & 1 deletion AppHandling/Get-NavContainerAppInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ try {
}
else {
$inArgs += @{ "ServerInstance" = $ServerInstance }
$apps = Get-NAVAppInfo @inArgs | Where-Object { (!$installedOnly) -or ($_.IsInstalled -eq $true) } | ForEach-Object { Get-NAVAppInfo -id "$($_.AppId)" -publisher $_.publisher -name $_.name -version $_.Version @inArgs }
$apps = Get-NAVAppInfo @inArgs | Where-Object { (!$installedOnly) -or ($_.IsInstalled -eq $true) } | ForEach-Object { Get-NAVAppInfo -id $_.AppId.value -publisher $_.publisher -name $_.name -version $_.Version @inArgs }
}

if ($sort -ne "None") {
Expand Down
5 changes: 3 additions & 2 deletions AppHandling/Publish-NavContainerApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ try {
if ($checkAlreadyInstalled) {
# Get Installed apps (if UseDevEndpoint is specified, only get global apps)
$installedApps = Get-BcContainerAppInfo -containerName $containerName -installedOnly | Where-Object { (-not $useDevEndpoint.IsPresent) -or ($_.Scope -eq 'Global') } | ForEach-Object {
@{ "id" = $_.appId; "publisher" = $_.publisher; "name" = $_.name; "version" = $_.Version }
@{ "id" = $_.appId.value.ToString(); "publisher" = $_.publisher; "name" = $_.name; "version" = $_.Version }
}
}
}
Expand All @@ -143,7 +143,8 @@ try {
# Get Installed apps (if UseDevEndpoint is specified, only get global apps)
$installedApps = Invoke-ScriptInCloudBcContainer -authContext $bcAuthContext -containerId $environment -scriptblock {
Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' | Where-Object { $_.IsInstalled -eq $true -and ((-not $useDevEndpoint.IsPresent) -or ($_.Scope -eq 'Global')) } | ForEach-Object {
Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' -id $_.AppId -publisher $_.publisher -name $_.name -version $_.Version }
Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' -id $_.AppId.value -publisher $_.publisher -name $_.name -version $_.Version } | ForEach-Object {
@{ "id" = $_.appId.value.ToString(); "publisher" = $_.publisher; "name" = $_.name; "version" = $_.Version }
}
}
else {
Expand Down
2 changes: 1 addition & 1 deletion AppHandling/Run-AlPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ Write-Host -ForegroundColor Yellow @'
param($appFile)
Get-NavAppInfo -Path $appFile
} -argumentList (Get-BcContainerPath -containerName $containerName -path $appFile)
$appId = $appInfo.AppId
$appId = $appInfo.AppId.ToString()
}
else {
$tmpFolder = Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())
Expand Down
6 changes: 3 additions & 3 deletions NuGet/Publish-BcNuGetPackageToContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Function Publish-BcNuGetPackageToContainer {
$isCloudBcContainer = isCloudBcContainer -authContext $bcAuthContext -containerId $environment
if ($isCloudBcContainer) {
$installedApps = @(Invoke-ScriptInCloudBcContainer -authContext $bcAuthContext -containerId $environment -scriptblock {
Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' | Where-Object { $_.IsInstalled -eq $true } | ForEach-Object { Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' -id $_.AppId -publisher $_.publisher -name $_.name -version $_.Version }
} | ForEach-Object { @{ "Publisher" = $_.Publisher; "Name" = $_.Name; "Id" = $_.AppId; "Version" = $_.Version } } )
Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' | Where-Object { $_.IsInstalled -eq $true } | ForEach-Object { Get-NAVAppInfo -ServerInstance $serverInstance -TenantSpecificProperties -tenant 'default' -id $_.AppId.value -publisher $_.publisher -name $_.name -version $_.Version }
} | ForEach-Object { @{ "Publisher" = $_.Publisher; "Name" = $_.Name; "Id" = $_.AppId.value.ToString(); "Version" = $_.Version } } )
# Get Country and Platform from the container
}
else {
Expand All @@ -81,7 +81,7 @@ Function Publish-BcNuGetPackageToContainer {
}
}
else {
$installedApps = @(Get-BcContainerAppInfo -containerName $containerName -installedOnly | ForEach-Object { @{ "Publisher" = $_.Publisher; "Name" = $_.Name; "Id" = $_.AppId; "Version" = $_.Version } } )
$installedApps = @(Get-BcContainerAppInfo -containerName $containerName -installedOnly | ForEach-Object { @{ "Publisher" = $_.Publisher; "Name" = $_.Name; "Id" = $_.AppId.value.ToString(); "Version" = $_.Version } } )
$installedPlatform = [System.Version](Get-BcContainerPlatformVersion -containerOrImageName $containerName)
$installedCountry = (Get-BcContainerCountry -containerOrImageName $containerName).ToLowerInvariant()
}
Expand Down

0 comments on commit 7b29e4c

Please sign in to comment.