Closed dfs111 closed 3 years ago
That doesn't seem to be the full scripts, nor the full output of the scripts. The only thing I can see from this is that you are using NavContainerHelper, which is no longer supported (hasn't been for a long time). BcContainerHelper is the module to use - and you need to remove all containers before switching over.
Hi again,
sorry about that.
I have added the real script and output now.
In order to achieve this, you would have to override the Create Container behavior. You can add a parameter -NewBcContainer to Run-AlPipeline:
Run-AlPipeline -parameter `
-parameter `
-NewBcContainer { Param([Hashtable]$parameters)
New-BcContainer @parameters
# Copy DLL's to container or share an Add-Ins folder in the line above
}
Basically this specifies a scriptblock, which Run-AlPipeline uses to create the container and now you can create the container as you see fit.
Hi again Freddy,
It works now :)
Thank you!
Hey @dfs111,
For kindness sake - could you share your example as an inspiration for others that also needs to include custom .dll files or scripts in Run-AlPipeline? I'm in the same boat. Would be very much appreciated.
Hey @dfs111,
For kindness sake - could you share your example as an inspiration for others that also needs to include custom .dll files or scripts in Run-AlPipeline? I'm in the same boat. Would be very much appreciated.
No problem here you go. @JeppeBylov I have made several other modifications, so it is not certain that this will work for you
#================================================================================
#================================================================================
$artifactUrl = Get-BCArtifactUrl -type 'OnPrem' -version 17 -country 'dk' -select 'Latest'
#========================================================================
$parameters = @{
"isolation" = "process"
"accept_eula" = $true
"containerName" = $containerName
"artifactUrl" = $artifactUrl
"auth" = 'Windows'
"DesktopFolder" = 'Desktop'
"includeTestToolkit" =$true
"licenseFile" = $LicenseFile
"memoryLimit" = "8G"
"updateHosts" = $true
"doNotExportObjectsToText" = $true
"includeAL" = $true
"shortCuts" = "DesktopFolder"
}
$restartMe = {
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSClientControls.dll" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSClientControls.dll"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSClientControls.dll.config" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSClientControls.dll.config"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSClientControls.pdb" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSClientControls.pdb"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSClientControls.tlb" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSClientControls.tlb"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSClientLogger.dll" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSClientLogger.dll"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSClientLogger.pdb" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSClientLogger.pdb"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSEnumerators.dll" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSEnumerators.dll"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSEnumerators.pdb" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSEnumerators.pdb"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSUtilities.dll" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSUtilities.dll"
Copy-FileToNavContainer -containerName $containerName -localPath "E:\FS\FSUtilities.pdb" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\FSUtilities.pdb"
# Copy-FileToNavContainer -containerName $containerName -localPath "c:\sources\New folder\Microsoft.Dynamics.Nav.Timer.dll" -containerPath "c:\Program Files\Microsoft Dynamics NAV\170\Service\Add-ins\Microsoft.Dynamics.Nav.Timer.dll"
Restart-BcContainer $containerName
}
#
#========================================================================
Run-AlPipeline @params `
-NewBcContainer { param([hashtable]$parameters)
New-BcContainer @parameters
Invoke-Command -ScriptBlock $restartMe
} `
-pipelinename $pipelineName `
-containerName $containerName `
-imageName $imageName `
-environment $environmentName `
-artifact $artifactUrl `
-memoryLimit $memoryLimit `
-baseFolder $baseFolder `
-licenseFile $LicenseFile `
-installApps $installApps `
-installTestApps $installTestApps `
-previousApps $previousApps `
-appFolders $appFolders `
-testFolders $testFolders `
-doNotRunTests:$doNotRunTests `
-testResultsFile $testResultsFile `
-testResultsFormat 'JUnit' `
-installTestRunner:$installTestRunner `
-installTestFramework:$installTestFramework `
-installTestLibraries:$installTestLibraries `
-installPerformanceToolkit:$installPerformanceToolkit `
-enableCodeCop:$enableCodeCop `
-enableAppSourceCop:$enableAppSourceCop `
-enablePerTenantExtensionCop:$enablePerTenantExtensionCop `
-enableUICop:$enableUICop `
-azureDevOps:($environment -eq 'AzureDevOps') `
-gitLab:($environment -eq 'GitLab') `
-gitHubActions:($environment -eq 'GitHubActions') `
-failOn 'error' `
-AppSourceCopMandatoryAffixes $appSourceCopMandatoryAffixes `
-AppSourceCopSupportedCountries $appSourceCopSupportedCountries `
-additionalCountries $additionalCountries `
-buildArtifactFolder $buildArtifactFolder `
-CreateRuntimePackages:$CreateRuntimePackages `
-appBuild $appBuild -appRevision $appRevision
#================================================================================
#================================================================================
PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!
Describe the issue The issue is, we are trying to import dll files from our azure devops to a container using Run-alpipeline I have put a screenshot to show what the error is saying.
Scripts used to create container and cause the issue
Full output of scripts
Screenshots If applicable, add screenshots to help explain your problem.
Additional context