microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
253 stars 115 forks source link

SyncMode for custom deployments? #1083

Closed cegekaJG closed 1 week ago

cegekaJG commented 1 month ago

Do the parameters passed to the custom deployment script .github/DeployTo{environmentType} include SyncMode? The current documentation doesn't mention it: https://github.com/microsoft/AL-Go/blob/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Scenarios/settings.md?plain=1#L253-L265 However, the Actions/Deploy/Deploy.ps1 code does append the hashtable $deploymentParameters, which does seem to include the parameter in question. If the parameter really isn't included, it really should be - it's just as necessary for OnPrem environments. If it is, the documentation needs to be updated.

On top of that, could you add a way to override the sync mode for a single deployment? Maybe as a parameter when manually triggering an action that includes the job. When using ForceSync, it generally is a one-time thing and leaving it enabled in a config file could cause problems, so letting developers trigger it explicitly outside of the repo files would make it easier and safer.

freddydk commented 1 month ago

You get all deploymentSettings transferred to your custom deployment script - I will add this to the docs. I guess it would make sense to add SyncMode to the Publish To Environment workflow with a default using the value from settings.

cegekaJG commented 1 month ago

If I create environment variables, are those passed as well? I currently use AUTHCONTEXT to pass additional parameters to the deployment script, but since the value is hidden it's not very convenient.

freddydk commented 1 month ago

You should be able to create custom fields under deployment settings in AL-Go settings. Currently we do not transfer variables under environments in GitHub.

cegekaJG commented 1 month ago

That didn't seem to work - according to the logs, the custom setting was passed between steps, but the DeployToOnPrem.ps1 script didn't contain it. The script starts with writing the param-hashtable to the output, so you can tell it's missing. logs_24056123663.zip