Skip to content

Commit

Permalink
Merge pull request #70 from freddydk/main
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
freddydk authored Mar 15, 2022
2 parents 72d1ea8 + 352c7ee commit 363ce51
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
18 changes: 13 additions & 5 deletions Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,10 @@ function AnalyzeRepo {
}
}

if ([Version]$settings.applicationDependency -gt [Version]$version) {
throw "Application dependency is set to $($settings.applicationDependency), which isn't compatible with the artifact version $version"
if (!$doNotCheckArtifactSetting) {
if ([Version]$settings.applicationDependency -gt [Version]$version) {
throw "Application dependency is set to $($settings.applicationDependency), which isn't compatible with the artifact version $version"
}
}

# unpack all dependencies and update app- and test dependencies from dependency apps
Expand Down Expand Up @@ -737,7 +739,7 @@ function CommitFromNewFolder {
if ($commitMessage.Length -gt 250) {
$commitMessage = "$($commitMessage.Substring(0,250))...)"
}
invoke-git commit -m "'$commitMessage'"
invoke-git commit --allow-empty -m "'$commitMessage'"
if ($branch) {
invoke-git push -u $serverUrl $branch
invoke-gh pr create --fill --head $branch --repo $env:GITHUB_REPOSITORY
Expand Down Expand Up @@ -909,6 +911,7 @@ function CreateDevEnv {
[Parameter(Mandatory=$true)]
[string] $baseFolder,
[string] $userName = $env:Username,
[string] $bcContainerHelperPath = "",

[Parameter(ParameterSetName='cloud')]
[Hashtable] $bcAuthContext = $null,
Expand All @@ -935,7 +938,10 @@ function CreateDevEnv {
}

$runAlPipelineParams = @{}
$BcContainerHelperPath = DownloadAndImportBcContainerHelper -baseFolder $baseFolder
$loadBcContainerHelper = ($bcContainerHelperPath -eq "")
if ($loadBcContainerHelper) {
$BcContainerHelperPath = DownloadAndImportBcContainerHelper -baseFolder $baseFolder
}
try {
if ($caller -eq "local") {
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
Expand Down Expand Up @@ -1174,7 +1180,9 @@ function CreateDevEnv {
-keepContainer
}
finally {
CleanupAfterBcContainerHelper -bcContainerHelperPath $bcContainerHelperPath
if ($loadBcContainerHelper) {
CleanupAfterBcContainerHelper -bcContainerHelperPath $bcContainerHelperPath
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Actions/CheckForUpdates/CheckForUpdates.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ try {
if ($status) {
$message = "Updated AL-Go System Files"

invoke-git commit -m "'$message'"
invoke-git commit --allow-empty -m "'$message'"

if ($directcommit) {
invoke-git push $url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ try {
-environmentName $environmentName `
-reUseExistingEnvironment:$reUseExistingEnvironment `
-baseFolder $repoBaseFolder `
-bcContainerHelperPath $bcContainerHelperPath `
-adminCenterApiCredentials ($adminCenterApiCredentials | ConvertFrom-Json | ConvertTo-HashTable)

CommitFromNewFolder -serverUrl $serverUrl -commitMessage "Create a development environment $environmentName" -branch $branch
Expand Down
10 changes: 6 additions & 4 deletions Actions/RunPipeline/RunPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ try {
else {
$storageContext = New-AzureStorageContext -StorageAccountName $storageAccount.StorageAccountName -StorageAccountKey $storageAccount.StorageAccountKey
}
Write-Host "Storage Context OK"
$storageContainerName = $storageAccount.ContainerName.ToLowerInvariant().replace('{project}',$projectName).ToLowerInvariant()
Get-AzureStorageContainer -Context $storageContext -name $storageContainerName | Out-Null
$storageBlobName = $storageAccount.BlobName.ToLowerInvariant()
Write-Host "Storage Context OK"
Write-Host "Storage Container Name is $storageContainerName"
Write-Host "Storage Blob Name is $storageBlobName"
Get-AzureStorageContainer -Context $storageContext -name $storageContainerName | Out-Null
}
catch {
OutputError -message "StorageContext secret is malformed. Needs to be formatted as Json, containing StorageAccountName, containerName, blobName and sastoken or storageAccountKey, which points to an existing container in a storage account."
exit
OutputWarning -message "StorageContext secret is malformed. Needs to be formatted as Json, containing StorageAccountName, containerName, blobName and sastoken or storageAccountKey, which points to an existing container in a storage account."
$storageContext = $null
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
environmentName: ${{ github.event.inputs.environmentName }}
reUseExistingEnvironment: ${{ github.event.inputs.reUseExistingEnvironment }}
directCommit: ${{ github.event.inputs.directCommit }}
adminCenterApiCredentials: ${{ env.adminCenterApiCredentials }}

PostProcess:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
parentTelemetryScopeJson: ${{ needs.Initialization.outputs.telemetryScopeJson }}
environmentName: ${{ github.event.inputs.environmentName }}
reUseExistingEnvironment: ${{ github.event.inputs.reUseExistingEnvironment }}
directCommit: ${{ github.event.inputs.directCommit }}
adminCenterApiCredentials: ${{ env.adminCenterApiCredentials }}

PostProcess:
Expand Down

0 comments on commit 363ce51

Please sign in to comment.