Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Custom Deploy.ps1 is not used #1143

Closed
StefanMaron opened this issue Jul 15, 2024 · 6 comments · Fixed by #1150
Closed

[Bug]: Custom Deploy.ps1 is not used #1143

StefanMaron opened this issue Jul 15, 2024 · 6 comments · Fixed by #1150
Labels
bug Something isn't working Fix Ready Fix Ready In Preview Currently available in AL-Go for GitHub preview

Comments

@StefanMaron
Copy link

AL-Go version

5.2

Describe the issue

I want to use the buildModes to deploy a different version to sandboxes than to AppSource, for licensing purposes.
The only way I found to achieve this is to create a modified deploy.ps1 script like described here:

> You can create one script to override all deployment functionality, by creating a script called Deploy.ps1 in the .github folder.

image

I did change those two parts:
image

but still logs the default message and used the main apps:
image

Is there anything I am missing or I can check to resolve this?

Expected behavior

Custom Deploy.ps1 should be used if put into .github folder

Steps to reproduce

create a custom Deploy.ps1 file, check the log output

Additional context (logs, screenshots, etc.)

No response

@StefanMaron StefanMaron added the bug Something isn't working label Jul 15, 2024
@freddydk
Copy link
Collaborator

freddydk commented Jul 15, 2024

Not sure buildModes should be used for this, @mazhelez do you know?

On the actual question - this is an error in the documentation - we support DeployTo<environmentType>.ps1 - we don't actually support a complete override of all.

Will fix the documentation.

@mazhelez
Copy link
Collaborator

In some cases, it does make sense to deploy the artifacts from the non-default build mode, as in this particular scenario.

Deploy action, however, seems to be wired to use the -Apps artifacts (from the default build mode).

$projectApps = @((Get-ChildItem -Path $artifactsFolder -Filter "$project-$refname-Apps-*.*.*.*") | ForEach-Object { $_.FullName })

However, in your custom script you can still query for other artifacts (the way you already do), so I believe if you fix your Deploy.ps1 to be .github/DeployTo<environmentType>.ps1, then it should work.

@StefanMaron
Copy link
Author

@mazhelez
After I changed the name to DeployToSandbox.ps1 and added "EnvironmentType": "Sandbox", to my deploy configuration, it seems to pick up the script now.

But why does this have to be so complicated? Now its failing because it expect a different parameter configuration than the original Deploy.ps1

@freddydk
If the BuildModes are not meant to be used in deployment or submission to appsource, what is the usecase of them?

@freddydk
Copy link
Collaborator

I think buildModes was introduced for something different, but it might make sense to add a field "buildMode" to the DeployTo<env> setting, this would greatly simplify this scenario I guess and make the buildModes more useful.

@StefanMaron
Copy link
Author

@freddydk This would solve this issue for me 100%

@freddydk
Copy link
Collaborator

freddydk commented Jul 23, 2024

Shipped in preview
DeployTo structure now includes a buildMode setting

@freddydk freddydk added Fix Ready Fix Ready In Preview Currently available in AL-Go for GitHub preview labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fix Ready Fix Ready In Preview Currently available in AL-Go for GitHub preview
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants