Skip to content

Commit 5234afb

Browse files
committed
add New-ALGoRepo
1 parent 6bfef32 commit 5234afb

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

AL-Go/New-ALGoRepo.ps1

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
function New-ALGoRepo {
22
Param(
3-
$tmpFolder = (Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())),
43
[Parameter(Mandatory=$true)]
54
$org,
65
[Parameter(Mandatory=$true)]
@@ -12,7 +11,8 @@
1211
[Parameter(Mandatory=$true)]
1312
[ValidateSet('public','private')]
1413
$accessControl,
15-
[Parameter(Mandatory=$true)]
14+
$algoBranch = 'main',
15+
$description = $repo,
1616
$apps = @(),
1717
[HashTable] $addRepoSettings = @{},
1818
[HashTable] $addProjectSettings = @{},
@@ -23,7 +23,8 @@
2323
[switch] $additionalCountriesAlways,
2424
[switch] $openFolder,
2525
[switch] $openVSCode,
26-
[switch] $openBrowser
26+
[switch] $openBrowser,
27+
$tmpFolder = (Join-Path ([System.IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString()))
2728
)
2829

2930
# Well known AppIds
@@ -205,18 +206,18 @@
205206
Set-Location $tmpFolder
206207

207208
$repository = "$org/$repo"
208-
invoke-gh repo create $repository --$accessControl --clone
209+
invoke-gh repo create $repository --$accessControl --clone --description $description
209210
$folder = Join-Path $tmpFolder $repo
210211
Set-Location $folder
211212

212213
Write-Host "Downloading and applying AL-Go-$AppType template"
213-
$templateUrl = "https://github.com/microsoft/AL-Go-$AppType/archive/refs/heads/main.zip"
214+
$templateUrl = "https://github.com/microsoft/AL-Go-$AppType/archive/refs/heads/$($algoBranch).zip"
214215
$tempZip = Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::NewGuid().ToString()).zip"
215216
Download-File -sourceUrl $templateUrl -destinationFile $tempZip
216217
Expand-7zipArchive -Path $tempZip -DestinationPath $folder
217218
Remove-Item -Path $tempZip -Force
218-
Copy-Item -Path "AL-Go-$appType-main\*" -Recurse -Destination . -Force
219-
Remove-Item -Path "AL-Go-$appType-main" -Recurse -Force
219+
Copy-Item -Path "AL-Go-$appType-$algoBranch\*" -Recurse -Destination . -Force
220+
Remove-Item -Path "AL-Go-$appType-$algoBranch" -Recurse -Force
220221

221222
Write-Host "Committing and pushing template"
222223
invoke-git -silent add *

BC.ALGoHelper.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
. (Join-Path $PSScriptRoot "AL-Go\New-ALGoAppSourceContext.ps1")
44
. (Join-Path $PSScriptRoot "AL-Go\New-ALGoStorageContext.ps1")
55
. (Join-Path $PSScriptRoot "AL-Go\New-ALGoNugetContext.ps1")
6-
#. (Join-Path $PSScriptRoot "AL-Go\New-ALGoRepo.ps1")
6+
. (Join-Path $PSScriptRoot "AL-Go\New-ALGoRepo.ps1")
77
#. (Join-Path $PSScriptRoot "AL-Go\New-ALGoRepoWizard.ps1")

BcContainerHelper.psd1

+4-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ FunctionsToExport = 'Add-FontsToBcContainer', 'Add-GitToAlProjectFolder',
131131
'Invoke-IngestionApiPut', 'Invoke-NavContainerCodeunit',
132132
'Invoke-ScriptInBcContainer', 'New-AadAppsForBc',
133133
'New-ALGoAppSourceContext', 'New-ALGoAuthContext',
134-
'New-ALGoNugetContext', 'New-ALGoStorageContext',
134+
'New-ALGoNugetContext', 'New-ALGoRepo', 'New-ALGoStorageContext',
135135
'New-AppSourceSubmission', 'New-BcAuthContext',
136136
'New-BcCompilerFolder', 'New-BcContainer', 'New-BcContainerBcUser',
137137
'New-BcContainerTenant', 'New-BcContainerWindowsUser',
@@ -257,7 +257,9 @@ PrivateData = @{
257257

258258
# ReleaseNotes of this module
259259
ReleaseNotes = '5.0.2
260-
Issue #2934 Add setting to containerHelper config: DoNotUseCdnForArtifacts to allow people to grab Artfacts directly from blob storage instead of CDN'
260+
Issue #2934 Add setting to containerHelper config: DoNotUseCdnForArtifacts to allow people to grab Artfacts directly from blob storage instead of CDN
261+
Issue #3047 Get-BCArtifactUrl -select Daily returns latest every time if a new major.minor is shipped
262+
Issue #3048 Unable to import .rapidstart file - ''Get-PackageInfoFromRapidStartFile'' is not recognized'
261263

262264
# Prerelease string of this module
263265
# Prerelease = ''

ReleaseNotes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Adding additional properties to telemetry. Set MicrosoftTelemetryConnectionStrin
117117
Add parameter 'features' to Run-AlPipeline which allows for setting the compiler features
118118
Add SchemaSyncMode to Publish-PerTenantExtensionApps
119119
Use submodules inside BcContainerHelper
120+
New PROOF OF CONCEPT PREVIEW function New-ALGoRepo to create a new AL-Go repository based on PTE or AppSource App templates
120121

121122
4.0.7
122123
Issue #2765 Unused param in Publish-BuildOutputToAzureFeed.ps1

0 commit comments

Comments
 (0)