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

Custom "DeployTo<EnvironmentType>.ps1" not triggering #886

Closed
cegekaJG opened this issue Jan 23, 2024 · 5 comments
Closed

Custom "DeployTo<EnvironmentType>.ps1" not triggering #886

cegekaJG opened this issue Jan 23, 2024 · 5 comments
Labels
Fix Ready Fix Ready question Further information is requested

Comments

@cegekaJG
Copy link
Contributor

I want to create a custom deployment process for an OnPrem environment using a PowerShell script, but it's not being executed during the CI/CD workflow.
I have the following:

  • A repository with AL Go 4.0 and 2 PTE applications
  • A repository environment called Docker
  • .github\AL-Go-Settings.json with the following parameters:
{
  "DeployToDocker":
  {
    "runs-on": "self-hosted",
    "environmentName": "bcserver",
    "environmentType": "OnPrem"
  },
  "doNotPublishApps": true,
  "enableCodeCop": true,
  "enablePerTenantExtensionCop": false,
  "enableUICop": true,
  "githubRunner": "ubuntu-latest",
  "runs-on": "ubuntu-latest",
  "skipUpgrade": true,
  "type": "PTE",
  "useCompilerFolder": true
}
  • A script called .github\DeployToOnPrem.ps1 that just prints the parameters given
  • A self-hosted GitHub runner with the label self-hosted

From what I can tell, the environment settings gets read successfully and the self-hosted runner executes the job as requested; but the Deploy step is performed by microsoft/AL-Go-Actions/Deploy@v4.0, and not DeployToOnPrem.ps1. The custom script is supposed to fire at this point, correct?

@freddydk
Copy link
Contributor

The custom script will be invoked inside Deploy@v4.0 - here:

$customScript = Join-Path $ENV:GITHUB_WORKSPACE ".github/DeployTo$($deploymentSettings.EnvironmentType).ps1"

Note that the script name is case sensitive under Linux - not on Windows.

@freddydk freddydk added question Further information is requested Fix Ready Fix Ready labels Jan 24, 2024
@cegekaJG
Copy link
Contributor Author

Ah, in my case the environment was missing the AUTHCONTEXT secret, because the test didn't require one. Adding it made everything run correctly.

@curateideas
Copy link

@cegekaJG : What did you enter in the AUTHCONTEXT secret? Seems it tries to connect to a SaaS Environment anyway, despite it's set to "OnPrem"...

@cegekaJG
Copy link
Contributor Author

I think I just entered {}. I didn't write it down and I can't see the secret value anymore.

@curateideas
Copy link

Ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Ready Fix Ready question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants