Skip to content

Commit

Permalink
Merge pull request #4 from andersgMSFT/main
Browse files Browse the repository at this point in the history
Update Al-go system files
  • Loading branch information
andersgMSFT authored Jun 3, 2024
2 parents b9ebf6e + 32582ce commit 366c867
Show file tree
Hide file tree
Showing 26 changed files with 1,780 additions and 1,582 deletions.
48 changes: 25 additions & 23 deletions .AL-Go/cloudDevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,45 @@
Param(
[string] $environmentName = "",
[bool] $reuseExistingEnvironment,
[switch] $fromVSCode
[switch] $fromVSCode,
[switch] $clean
)

$ErrorActionPreference = "stop"
Set-StrictMode -Version 2.0
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0

try {
Clear-Host
Write-Host
Write-Host -ForegroundColor Yellow @'
_____ _ _ _____ ______
/ ____| | | | | __ \ | ____|
| | | | ___ _ _ __| | | | | | _____ __ |__ _ ____ __
| | | |/ _ \| | | |/ _` | | | | |/ _ \ \ / / __| | '_ \ \ / /
| |____| | (_) | |_| | (_| | | |__| | __/\ V /| |____| | | \ V /
\_____|_|\___/ \__,_|\__,_| |_____/ \___| \_/ |______|_| |_|\_/
'@

$webClient = New-Object System.Net.WebClient
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
$webClient.Encoding = [System.Text.Encoding]::UTF8
Write-Host "Downloading GitHub Helper module"
$GitHubHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/Github-Helper.psm1'
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/PPPreview/Github-Helper.psm1', $GitHubHelperPath)
Write-Host "Downloading AL-Go Helper script"
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
$ALGoHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/AL-Go-Helper.ps1'
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/PPPreview/AL-Go-Helper.ps1', $ALGoHelperPath)
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)

Import-Module $GitHubHelperPath
. $ALGoHelperPath -local

$baseFolder = GetBaseFolder -folder $PSScriptRoot
$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot

Clear-Host
Write-Host
Write-Host -ForegroundColor Yellow @'
_____ _ _ _____ ______
/ ____| | | | | __ \ | ____|
| | | | ___ _ _ __| | | | | | _____ __ |__ _ ____ __
| | | |/ _ \| | | |/ _` | | | | |/ _ \ \ / / __| | '_ \ \ / /
| |____| | (_) | |_| | (_| | | |__| | __/\ V /| |____| | | \ V /
\_____|_|\___/ \__,_|\__,_| |_____/ \___| \_/ |______|_| |_|\_/
'@

Write-Host @'
This script will create a cloud based development environment (Business Central SaaS Sandbox) for your project.
All apps and test apps will be compiled and published to the environment in the development scope.
The script will also modify launch.json to have a "Cloud Sandbox (<name>)" configuration point to your environment.
Expand All @@ -52,8 +55,6 @@ if (Test-Path (Join-Path $PSScriptRoot "NewBcContainer.ps1")) {
Write-Host -ForegroundColor Red "WARNING: The project has a NewBcContainer override defined. Typically, this means that you cannot run a cloud development environment"
}

$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME

Write-Host

if (-not $environmentName) {
Expand All @@ -78,7 +79,8 @@ CreateDevEnv `
-environmentName $environmentName `
-reuseExistingEnvironment:$reuseExistingEnvironment `
-baseFolder $baseFolder `
-project $project
-project $project `
-clean:$clean
}
catch {
Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)"
Expand Down
53 changes: 29 additions & 24 deletions .AL-Go/localDevEnv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,50 @@
#
Param(
[string] $containerName = "",
[ValidateSet("UserPassword", "Windows")]
[string] $auth = "",
[pscredential] $credential = $null,
[string] $licenseFileUrl = "",
[string] $insiderSasToken = "",
[switch] $fromVSCode
[switch] $fromVSCode,
[switch] $accept_insiderEula,
[switch] $clean
)

$ErrorActionPreference = "stop"
Set-StrictMode -Version 2.0
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0

try {
Clear-Host
Write-Host
Write-Host -ForegroundColor Yellow @'
_ _ _____ ______
| | | | | __ \ | ____|
| | ___ ___ __ _| | | | | | _____ __ |__ _ ____ __
| | / _ \ / __/ _` | | | | | |/ _ \ \ / / __| | '_ \ \ / /
| |____ (_) | (__ (_| | | | |__| | __/\ V /| |____| | | \ V /
|______\___/ \___\__,_|_| |_____/ \___| \_/ |______|_| |_|\_/
'@

$webClient = New-Object System.Net.WebClient
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
$webClient.Encoding = [System.Text.Encoding]::UTF8
Write-Host "Downloading GitHub Helper module"
$GitHubHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/Github-Helper.psm1'
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/PPPreview/Github-Helper.psm1', $GitHubHelperPath)
Write-Host "Downloading AL-Go Helper script"
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
$ALGoHelperUrl = 'https://raw.githubusercontent.com/microsoft/AL-Go/6a9ef0c91e5b54d0fd3abb3d4495417a1db28f17/Actions/AL-Go-Helper.ps1'
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
$webClient.DownloadFile('https://raw.githubusercontent.com/microsoft/AL-Go-Actions/PPPreview/AL-Go-Helper.ps1', $ALGoHelperPath)
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)

Import-Module $GitHubHelperPath
. $ALGoHelperPath -local

$baseFolder = GetBaseFolder -folder $PSScriptRoot
$project = GetProject -baseFolder $baseFolder -projectALGoFolder $PSScriptRoot

Clear-Host
Write-Host
Write-Host -ForegroundColor Yellow @'
_ _ _____ ______
| | | | | __ \ | ____|
| | ___ ___ __ _| | | | | | _____ __ |__ _ ____ __
| | / _ \ / __/ _` | | | | | |/ _ \ \ / / __| | '_ \ \ / /
| |____ (_) | (__ (_| | | | |__| | __/\ V /| |____| | | \ V /
|______\___/ \___\__,_|_| |_____/ \___| \_/ |______|_| |_|\_/
'@

Write-Host @'
This script will create a docker based local development environment for your project.
NOTE: You need to have Docker installed, configured and be able to create Business Central containers for this to work.
Expand All @@ -55,7 +59,7 @@ The script will also modify launch.json to have a Local Sandbox configuration po
'@

$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME
$settings = ReadSettings -baseFolder $baseFolder -project $project -userName $env:USERNAME -workflowName 'localDevEnv'

Write-Host "Checking System Requirements"
$dockerProcess = (Get-Process "dockerd" -ErrorAction Ignore)
Expand Down Expand Up @@ -102,8 +106,8 @@ if (-not $credential) {

if (-not $licenseFileUrl) {
if ($settings.type -eq "AppSource App") {
$description = "When developing AppSource Apps, your local development environment needs the developer licensefile with permissions to your AppSource app object IDs"
$default = ""
$description = "When developing AppSource Apps for Business Central versions prior to 22, your local development environment needs the developer licensefile with permissions to your AppSource app object IDs"
$default = "none"
}
else {
$description = "When developing PTEs, you can optionally specify a developer licensefile with permissions to object IDs of your dependant apps"
Expand Down Expand Up @@ -132,7 +136,8 @@ CreateDevEnv `
-auth $auth `
-credential $credential `
-licenseFileUrl $licenseFileUrl `
-insiderSasToken $insiderSasToken
-accept_insiderEula:$accept_insiderEula `
-clean:$clean
}
catch {
Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)"
Expand Down
2 changes: 1 addition & 1 deletion .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "PTE",
"templateUrl": "https://github.com/Microsoft/AL-Go-PTE@PPPreview",
"templateUrl": "https://github.com/Microsoft/al-go-pte@preview",
"powerPlatformSolutionFolder": "WarehouseHelper",
"environments": [
"Staging"
Expand Down
Loading

0 comments on commit 366c867

Please sign in to comment.