Skip to content

Commit

Permalink
Merge pull request #12 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 7e0af73 + 6c2d17b commit 6a42fc0
Show file tree
Hide file tree
Showing 26 changed files with 1,776 additions and 1,576 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
49 changes: 27 additions & 22 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 @@ -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
14 changes: 7 additions & 7 deletions .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "PTE",
"templateUrl": "https://github.com/microsoft/AL-Go-PTE@PPPreview",
"templateUrl": "https://github.com/Microsoft/al-go-pte@preview",
"powerPlatformSolutionFolder": "TakeOrder",
"environments": [
"Staging"
],
"DeployToStaging": {
"environmentName": "Sandbox",
"companyId": "f1678e37-e50b-ef11-9f8e-6045bdc8c192",
"ppEnvironmentUrl": "https://orgf287aea1.crm.dynamics.com/"
}
}
"DeployToStaging": {
"environmentName": "Sandbox",
"companyId": "f1678e37-e50b-ef11-9f8e-6045bdc8c192",
"ppEnvironmentUrl": "https://orgf287aea1.crm.dynamics.com/"
}
}
Loading

0 comments on commit 6a42fc0

Please sign in to comment.