kine / nvrappdevops Goto Github PK
View Code? Open in Web Editor NEWNavertica DevOps scripts for managing Microsoft Dynamics 365 Business Central Apps
Navertica DevOps scripts for managing Microsoft Dynamics 365 Business Central Apps
The v24 VSIX has Code Analyzer DLLs in a different directory than alc.exe
They are located in alc\extension\bin\Analyzers while alc.exe is in alc\extension\bin\win32
This breaks the Code Analyzers in Compile-AppWithArtifact as they are being searched in the wrong path
Hi!
Could you maybe add a license to this project?
In Compile-AppWithArtifact, we need to copy the new Business Foundation app to the build folder like other MS core apps.
Adding to https://github.com/kine/NVRAppDevOps/blob/7d4173347d238d26064aa3ad206a2130f9c1c64b/NVRAppDevOps/Compile-AppWithArtifact.ps1#L48C2-L54C119
(Join-Path $AppPath "\Applications.*\Microsoft_Business Foundation_*.app"),
resolves issue
Using BC24.0.16336.0
The following error occurs when trying to compile with artifact:
Removing C:\Users\BUILDA1\AppData\Local\Temp\alc
Locating the vsix path in c:\bcartifacts.cache\sandbox\24.0.16336.0\platform
Extracting ALLanguage.vsix into C:\Users\BUILDA~1\AppData\Local\Temp\alc
using 7zip
##[debug]Leaving C:\agent_work_tasks\CompileBCApps_6d011eb8-627b-48f8-8fef-506f72da1626\4.1.0\compileapptask.ps1.
##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]Get-ALCompilerFromArtifact : Cannot bind argument to parameter 'Path' because it is null.
##[debug]At C:\Program Files\WindowsPowerShell\Modules\NVRAppDevOps\2.6.6\Compile-ALProjectTree.ps1:119 char:32
##[debug]+ ... $alcPath = Get-ALCompilerFromArtifact -artifactUrl $artifactUrl -Tar ...
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug] + CategoryInfo : InvalidData: (:) [Get-ALCompilerFromArtifact], ParameterBindingValidationException
##[debug] + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Get-ALCompilerFromArtifact
##[debug]
##[debug]Script stack trace:
##[debug]at Get-ALCompilerFromArtifact, C:\Program Files\WindowsPowerShell\Modules\NVRAppDevOps\2.6.6\Get-ALCompilerFromArtifact.ps1: line 50
##[debug]at Compile-ALProjectTree, C:\Program Files\WindowsPowerShell\Modules\NVRAppDevOps\2.6.6\Compile-ALProjectTree.ps1: line 119
##[debug]at , C:\agent_work_tasks\CompileBCApps_6d011eb8-627b-48f8-8fef-506f72da1626\4.1.0\compileapptask.ps1: line 72
##[debug]at , : line 1
##[debug]at , : line 22
##[debug]at , : line 18
##[debug]at , : line 1
##[debug]Exception:
##[debug]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
##[debug] at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
##[debug] at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
##[debug] at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
##[debug] at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
##[debug] at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
##[debug] at System.Management.Automation.CommandProcessorBase.Complete()
##[error]Cannot bind argument to parameter 'Path' because it is null.
##[debug]Processed: ##vso[task.logissue type=error]Cannot bind argument to parameter 'Path' because it is null.
Looking at the source for Get-ALCompilerFromArtifact, it looks like it is purposely filtering away the win32 binary for alc.exe, resulting in no alc.exe being found in the search of the extracted vsix. Should the -notlike "*win32*" be a -like?
The navcontainerhelper function Compile-AppInNavContainer have support for running the CodeCop analyzer and storing the output with the compiler output.
[switch]$EnableCodeCop,
[ValidateSet('none','error','warning')]
[string]$FailOn = 'none'
Please enable this in Compile-ALProjectTree.ps1, so that we can get this information into DevOps. Very valuable for the code review.
There is missing process for pulling .app from package manager if it is missing during compile or install process.
Support function Install-ALNugetPackage already exists, but is not used.
Possibility to define own process for downloading missing app in settings.ps1 will be welcome - variable AppDownloadScript is prepared in the config for this.
I am getting the following error;
A parameter cannot be found that matches parameter name 'AllowPrerelease'.
Log;
2021-03-16T18:25:14.9025917Z ##[section]Starting: installbcmodules
2021-03-16T18:25:14.9156917Z ==============================================================================
2021-03-16T18:25:14.9157180Z Task : Business Central - Install powershell modules
2021-03-16T18:25:14.9157403Z Description : Install NVRAppDevOps and bccontainerhelper PowerShell modules
2021-03-16T18:25:14.9157574Z Version : 3.6.0
2021-03-16T18:25:14.9157702Z Author : Kine
2021-03-16T18:25:14.9157974Z Help : Will check if PowerShell modules NVRAppDevOps and bccontainerhelper are installed in latest version. If not, they will be installed or updated as needed.
2021-03-16T18:25:14.9158421Z ==============================================================================
2021-03-16T18:25:15.9441488Z Checking and Installing needed modules
2021-03-16T18:25:19.7477811Z ##[error]A parameter cannot be found that matches parameter name 'AllowPrerelease'.
2021-03-16T18:25:19.7722428Z ##[section]Finishing: installbcmodules
Yaml;
trigger:
pool: default
steps:
task: installbcmodules@3
inputs:
UninstallOldVersions: false
allowPreRelease: true
task: createbccontainer@5
inputs:
containername: 'bcserver'
artifactUrl: 'https://bcartifacts.azureedge.net/onprem/17.5.22499.22546/gb'
isolation: 'default'
ram: '4GB'
auth: 'NavUserPassword'
username: 'admin'
password: 'P@ssw0rd'
includeCSide: false
imagename:
useBestContainerOS: true
Hello Kamil,
in Read-ALTestResult we're getting an exception since updating our containers to spring release.
Exception calling "ReadMultiple" with "3" argument(s): "The request failed with HTTP status 404: Not Found."
$_.Exception.StackTrace
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
This doesnt seem to be related to your module but it effects it.
Do you get the same error?
Thank you for your help.
Hello,
On following line, $containerRulesetFile should be $rulesetfile as that is what is passed into Compile-AppWithArtifact by param.
Hey Kamil,
after running a build using your template the CALTestResults Page 130405 is available as a web service, because it has been added to the Web Services Page. I've created a bc container manually with "importtesttoolkit" and the page is not available as a web service page, it exists though.
Is there some magic happening to add the page to Web Services and can you point to me it? Else your Read-ALTestResult could not work, but it does ๐คทโโ๏ธ
I am a new user. Cloned today and get the following errors;
PS C:\Users\admincwatson\NVRAppDevOps\MSDyn365BC_AppTemplate> Read-ALConfiguration -path . | Init-ALEnvironment
Running .\Scripts\Settings.ps1 ...
Build is
Cannot index into a null array.
At C:\Users\admincwatson\Documents\WindowsPowerShell\Modules\NVRAppDevOps\0.9.93\Get-ContainerImageCurrentness.ps1:23 char:9
$result = $matches.Matches.Groups[2].Value.Split(':');
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cannot index into a null array.
At C:\Users\admincwatson\Documents\WindowsPowerShell\Modules\NVRAppDevOps\0.9.93\Get-ContainerImageCurrentness.ps1:24 char:9
$Registry = $matches.Matches.Groups[1].Value.Split('/')[0];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cannot index into a null array.
At C:\Users\admincwatson\Documents\WindowsPowerShell\Modules\NVRAppDevOps\0.9.93\Get-ContainerImageCurrentness.ps1:25 char:9
$ImageName = $result[0];
~~~~~~~~~~~~~~~~~~~~~~~
Cannot index into a null array.
At C:\Users\admincwatson\Documents\WindowsPowerShell\Modules\NVRAppDevOps\0.9.93\Get-ContainerImageCurrentness.ps1:26 char:9
$ImageTag = $result[1];
~~~~~~~~~~~~~~~~~~~~~~
Cannot read data about the image from server, rather pulling
Hi Kine,
I got below error when running Business Central - Compile App in Container. Usually, I don't have any issue using it in the pipeline until yesterday.
Hello Kamil,
is there a reason why you use $Build in Init-ALEnviroment
NVRAppDevOps/Init-ALEnvironment.ps1
Line 61 in 87e34a3
instead of $env:TF_Build like you do in Compile-ALProjectTree?
NVRAppDevOps/Compile-ALProjectTree.ps1
Line 67 in 87e34a3
Greetings,
Maurice
When creating new container by using Init-ALEnvironment or through BCTask createbccontainer from https://marketplace.visualstudio.com/items?itemName=Kine.naverticaltasks (which is internally calling this function).
Reason was implicit using of '-e CustomNavSettings=ServicesUseNTLMAuthentication=true' parameter for the new-bccontainer cmdlet which makes the endpoint unusable.
Solution:
This implicit parameter was removed. If needed, optionalParameters could be used to set it again.
Connected to #1a624b5905f7ae85ea45a0439c170250069c2565
After PR #23 you can get warning like
Get-ContainerImageCurrentness -Image bcinsider.azurecr.io/bconprem:cz
WARNING: The image mcr.microsoft.com/bconprem:cz could not be found locally
The local version of the image mcr.microsoft.com/bconprem:cz is NOT the latest version
because the function Get-ContainerImageCurrentness is taking the Image but is not parsing the registry correctly from the Image.
So far the path to the settings file/script is hardcoded in the PowerShell function. Wouldn't it be much better to parameterize this path as well or to configure it somewhere? So it would be much easier to use it for other DevOps scenarios without adjustments.
NVRAppDevOps/Read-ALConfiguration.ps1
Lines 17 to 21 in 18d4b74
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.