navcontainerhelper
navcontainerhelper copied to clipboard
Docs on how to handle NuGet Runtime Packages
Describe the issue Hi this is not an issue in the sense of it's not working but missing documentation or pointers to such documentation.
I'm trying to adopt the NuGet scripts for our CI/CD and had a really hard time figuring out how to run the scripts correctly for Runtimes to work as intented. I'll include my script below because I need someone to tell me if I did this right or if I'm missing the obvious easy path I should have taken. I worked based on the slides from the BC TechDays but even with that information it still took me hours to get it right. I don't think such a fundamental thing should be this hard so we make the barrier of entry lower for better adoption rates.
My proposal would be to A) Write a post for Freddy's Blog on how to Push and Pull Runtimes with NuGet and B) include examples for runtimes in the documentation headers of the Push and Pull Scripts. Some general guidelines on how to setup Feeds, (prelease, release, runtimes, internal, external would also be appreciated)
I would really like to see large scale adoption of this technologie but handling runtimes is still a big part of that and needs to be easy. Ideally there should be a cmdlet/parameter that just does it correctly out of the box.
I've used the slide below to get this far. Is it correct that runtimes can only be pulled with 'Download-BcNuGetPackageToFolder' because 'Get-BcNuGetPackage' doesn't explore the dependencies and therefore will never find the actual apps?
Scripts used to create container and cause the issue Pushing Runtimes:
foreach ($app in $apps.FullName) {
$appJson = Get-AppJsonFromAppFile -appFile $app
$packageName = Get-BcNuGetPackageId -publisher $appJson.publisher -name $appJson.name -id $appJson.id -version $appJson.version -tag 'runtime'
$feed, $packageId, $packageVersion = Find-BcNuGetPackage `
-nuGetServerUrl $nugetserverurl `
-nuGetToken $nugetToken `
-packageName $packageName `
-version $appJson.version `
-select Exact
if ($packageVersion -eq $appJson.version) {
continue
}
$NugetPackage = New-BcNuGetPackage `
-appfile $app `
-isIndirectPackage `
-packageId "{publisher}.{name}.runtime.{id}" `
-dependencyIdTemplate "{publisher}.{name}.runtime.{id}" #-prereleaseTag 'runtime'
Push-BcNuGetPackage -nuGetServerUrl $nugetserverurl -nuGetToken $nugetToken -bcNuGetPackage $NugetPackage
$NugetPackage = New-BcNuGetPackage `
-appfile $app `
-packageId "{publisher}.{name}.runtime-{version}" `
-dependencyIdTemplate "{publisher}.{name}.runtime.{id}" #-prereleaseTag 'runtime'
Push-BcNuGetPackage -nuGetServerUrl $nugetserverurl -nuGetToken $nugetToken -bcNuGetPackage $NugetPackage
}
Pulling Runtimes:
$packageName = Get-BcNuGetPackageId -publisher 'TRASER Software GmbH' -name 'TRASER Core' -id '***' -tag 'runtime'
Download-BcNuGetPackageToFolder `
-nuGetServerUrl $nugetserverurl `
-nuGetToken $nugetToken `
-packageName $packageName `
-folder "C:\***\out" `
-downloadDependencies allButMicrosoft
Screenshots