From dc35bf7a3f16085fbd8f308ebe9ef65014689aff Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 28 Feb 2022 23:56:32 +0100 Subject: [PATCH 01/19] Test change on SA --- .../storageAccounts/fileServices/shares/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json b/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json index 56f8d9ca40..badc0a2285 100644 --- a/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json +++ b/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json @@ -1,4 +1,4 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.4" + "version": "0.5" } From 24e459d0ac4b04d6bd3c9e0428256f00fc5d15cd Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 28 Feb 2022 23:56:57 +0100 Subject: [PATCH 02/19] Testing diff with main --- .../pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index f0dfed8001..3de15faf6a 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -28,11 +28,11 @@ function Get-ModifiedFileList { [string] $Commit = 'HEAD', [Parameter(Mandatory = $false)] - [string] $CompareCommit = 'HEAD^' + [string] $CompareCommit = 'main' ) - Write-Verbose "Gathering modified files between [$CompareCommit] and [$Commit]" -Verbose - $Diff = git diff --name-only --diff-filter=AM $CompareCommit $Commit + Write-Verbose "Gathering modified files between curent branch and main" -Verbose + $Diff = git diff --name-only --diff-filter=AM main $ModifiedFiles = $Diff | Get-Item -Force return $ModifiedFiles From 1981a8dacb0f001490f04f6367d9de262268ce10 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 1 Mar 2022 00:22:27 +0100 Subject: [PATCH 03/19] Rapid test of SA --- .../ms.storage.storageaccounts.yml | 28 ++-- .../workflows/ms.storage.storageaccounts.yml | 132 +++++++++--------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml b/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml index 0dafd10e8b..76111f73d9 100644 --- a/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml +++ b/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml @@ -30,21 +30,21 @@ variables: value: '/arm/Microsoft.Storage/storageAccounts' stages: - - stage: Validation - displayName: Pester tests - jobs: - - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml + # - stage: Validation + # displayName: Pester tests + # jobs: + # - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml - - stage: Deployment - displayName: Deployment tests - jobs: - - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml - parameters: - removeDeployment: '${{ parameters.removeDeployment }}' - deploymentBlocks: - - path: $(modulePath)/.parameters/min.parameters.json - - path: $(modulePath)/.parameters/parameters.json - - path: $(modulePath)/.parameters/v1.parameters.json + # - stage: Deployment + # displayName: Deployment tests + # jobs: + # - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml + # parameters: + # removeDeployment: '${{ parameters.removeDeployment }}' + # deploymentBlocks: + # - path: $(modulePath)/.parameters/min.parameters.json + # - path: $(modulePath)/.parameters/parameters.json + # - path: $(modulePath)/.parameters/v1.parameters.json - stage: Publishing displayName: Publish module diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index aeb32ad24f..7481a1516d 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -37,71 +37,71 @@ jobs: ############################ # SET INPUT PARAMETERS # ############################ - job_set_workflow_param: - runs-on: ubuntu-20.04 - name: 'Set input parameters to output variables' - steps: - - name: 'Checkout' - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: 'Set input parameters' - id: get-workflow-param - uses: ./.github/actions/templates/getWorkflowInput - with: - workflowPath: '${{ env.workflowPath}}' - outputs: - removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} + # job_set_workflow_param: + # runs-on: ubuntu-20.04 + # name: 'Set input parameters to output variables' + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # - name: 'Set input parameters' + # id: get-workflow-param + # uses: ./.github/actions/templates/getWorkflowInput + # with: + # workflowPath: '${{ env.workflowPath}}' + # outputs: + # removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} - #################### - # Pester Tests # - #################### - job_module_pester_validation: - runs-on: ubuntu-20.04 - name: 'Pester tests' - steps: - - name: 'Checkout' - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: 'Run tests' - uses: ./.github/actions/templates/validateModulePester - with: - modulePath: '${{ env.modulePath }}' + # #################### + # # Pester Tests # + # #################### + # job_module_pester_validation: + # runs-on: ubuntu-20.04 + # name: 'Pester tests' + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # - name: 'Run tests' + # uses: ./.github/actions/templates/validateModulePester + # with: + # modulePath: '${{ env.modulePath }}' - #################### - # Deployment tests # - #################### - job_module_deploy_validation: - runs-on: ubuntu-20.04 - name: 'Deployment tests' - needs: - - job_set_workflow_param - - job_module_pester_validation - strategy: - fail-fast: false - matrix: - parameterFilePaths: - ['parameters.json', 'min.parameters.json', 'v1.parameters.json'] - steps: - - name: 'Checkout' - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set environment variables - uses: deep-mm/set-variables@v1.0 - with: - variableFileName: 'global.variables' - - name: 'Using parameter file [${{ matrix.parameterFilePaths }}]' - uses: ./.github/actions/templates/validateModuleDeployment - with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - parameterFilePath: '${{ env.modulePath }}/.parameters/${{ matrix.parameterFilePaths }}' - location: '${{ env.defaultLocation }}' - resourceGroupName: '${{ env.resourceGroupName }}' - subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - removeDeployment: '${{ needs.job_set_workflow_param.outputs.removeDeployment }}' + # #################### + # # Deployment tests # + # #################### + # job_module_deploy_validation: + # runs-on: ubuntu-20.04 + # name: 'Deployment tests' + # needs: + # - job_set_workflow_param + # - job_module_pester_validation + # strategy: + # fail-fast: false + # matrix: + # parameterFilePaths: + # ['parameters.json', 'min.parameters.json', 'v1.parameters.json'] + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # - name: Set environment variables + # uses: deep-mm/set-variables@v1.0 + # with: + # variableFileName: 'global.variables' + # - name: 'Using parameter file [${{ matrix.parameterFilePaths }}]' + # uses: ./.github/actions/templates/validateModuleDeployment + # with: + # templateFilePath: '${{ env.modulePath }}/deploy.bicep' + # parameterFilePath: '${{ env.modulePath }}/.parameters/${{ matrix.parameterFilePaths }}' + # location: '${{ env.defaultLocation }}' + # resourceGroupName: '${{ env.resourceGroupName }}' + # subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + # managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + # removeDeployment: '${{ needs.job_set_workflow_param.outputs.removeDeployment }}' ############### # PUBLISH # @@ -110,9 +110,9 @@ jobs: name: 'Publish module' if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' runs-on: ubuntu-20.04 - needs: - - job_set_workflow_param - - job_module_deploy_validation + # needs: + # - job_set_workflow_param + # - job_module_deploy_validation steps: - name: 'Checkout' uses: actions/checkout@v2 From bf12cf77a0af7777c07ae6ed74110d6a53d4bab0 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 09:44:52 +0100 Subject: [PATCH 04/19] Test remote and branch --- utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 3de15faf6a..c8b2a356d9 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -32,7 +32,9 @@ function Get-ModifiedFileList { ) Write-Verbose "Gathering modified files between curent branch and main" -Verbose - $Diff = git diff --name-only --diff-filter=AM main + git remote + git branch + $Diff = git diff --name-only --diff-filter=AM origin/main $ModifiedFiles = $Diff | Get-Item -Force return $ModifiedFiles From 1466e349823370521fcc50ce96883441995e3938 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 09:56:32 +0100 Subject: [PATCH 05/19] remove remote and branch --- utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index c8b2a356d9..b393b3a324 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -32,8 +32,6 @@ function Get-ModifiedFileList { ) Write-Verbose "Gathering modified files between curent branch and main" -Verbose - git remote - git branch $Diff = git diff --name-only --diff-filter=AM origin/main $ModifiedFiles = $Diff | Get-Item -Force From c65829412a76c76479540446fcd947cdb74d4bc8 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 12:31:47 +0100 Subject: [PATCH 06/19] Test with head and some other logic --- .../resourcePublish/Get-ModulesToPublish.ps1 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index b393b3a324..9fff009733 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -23,16 +23,15 @@ Get modified files between previous and current commit. #> function Get-ModifiedFileList { [CmdletBinding()] - param ( - [Parameter(Mandatory = $false)] - [string] $Commit = 'HEAD', - - [Parameter(Mandatory = $false)] - [string] $CompareCommit = 'main' - ) + param () Write-Verbose "Gathering modified files between curent branch and main" -Verbose - $Diff = git diff --name-only --diff-filter=AM origin/main + $CurrentBranch = Get-GitBranchName + if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { + $Diff = git diff --name-only --diff-filter=AM $CurrentBranch^..$CurrentBranch + } else { + $Diff = git diff --name-only --diff-filter=AM origin/HEAD + } $ModifiedFiles = $Diff | Get-Item -Force return $ModifiedFiles From 34e2b1948ef9501938de5bb86a5260c4d4c0ad1e Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 12:35:15 +0100 Subject: [PATCH 07/19] fetch --- utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 9fff009733..1b5e83017a 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -26,6 +26,7 @@ function Get-ModifiedFileList { param () Write-Verbose "Gathering modified files between curent branch and main" -Verbose + git fetch $CurrentBranch = Get-GitBranchName if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { $Diff = git diff --name-only --diff-filter=AM $CurrentBranch^..$CurrentBranch From bf22eea1f1c5a465d55356309cb4c5728371a64b Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 12:42:12 +0100 Subject: [PATCH 08/19] test --- utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 1b5e83017a..63617817f1 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -26,7 +26,7 @@ function Get-ModifiedFileList { param () Write-Verbose "Gathering modified files between curent branch and main" -Verbose - git fetch + git branch --remotes --list '*/HEAD' $CurrentBranch = Get-GitBranchName if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { $Diff = git diff --name-only --diff-filter=AM $CurrentBranch^..$CurrentBranch From 9d09372ac029da84821b85d2197220a7df82f8c8 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 13:01:07 +0100 Subject: [PATCH 09/19] test --- .github/workflows/ms.storage.storageaccounts.yml | 2 ++ utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 7481a1516d..028a39d269 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -118,6 +118,8 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - pwsh: | + git branch --remotes --list '*/HEAD' - name: Set environment variables uses: deep-mm/set-variables@v1.0 with: diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 63617817f1..9fff009733 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -26,7 +26,6 @@ function Get-ModifiedFileList { param () Write-Verbose "Gathering modified files between curent branch and main" -Verbose - git branch --remotes --list '*/HEAD' $CurrentBranch = Get-GitBranchName if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { $Diff = git diff --name-only --diff-filter=AM $CurrentBranch^..$CurrentBranch From 4e5f9cc370e15e0ddf0da69828f620e0f3e7367b Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 1 Mar 2022 13:03:43 +0100 Subject: [PATCH 10/19] Update ms.storage.storageaccounts.yml --- .github/workflows/ms.storage.storageaccounts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 028a39d269..e4fa4a25e9 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -118,8 +118,8 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - pwsh: | - git branch --remotes --list '*/HEAD' + - run: + git branch --remotes --list '*/HEAD' - name: Set environment variables uses: deep-mm/set-variables@v1.0 with: From 2700f76e440ed4a5dbe6058db24e9718c8c56bc4 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 13:07:32 +0100 Subject: [PATCH 11/19] test --- .github/workflows/ms.storage.storageaccounts.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 028a39d269..4ff56377e3 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -120,6 +120,10 @@ jobs: fetch-depth: 0 - pwsh: | git branch --remotes --list '*/HEAD' + git fetch + git branch + git branch --remotes + git remote - name: Set environment variables uses: deep-mm/set-variables@v1.0 with: From 81a9b98bc9aa040bde0f63f7fb0691126b88ba1a Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 13:10:50 +0100 Subject: [PATCH 12/19] test --- .github/workflows/ms.storage.storageaccounts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index e42b4df9a0..19e9da20f1 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -124,6 +124,7 @@ jobs: git branch git branch --remotes git remote + shell: pwsh - name: Set environment variables uses: deep-mm/set-variables@v1.0 with: From 3dbcd598832bd1d8f81ac552f7451fe674cfb6ad Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 13:20:19 +0100 Subject: [PATCH 13/19] Check content in env --- .github/workflows/ms.storage.storageaccounts.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 19e9da20f1..124907e2d2 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -118,12 +118,8 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - run: - git branch --remotes --list '*/HEAD' - git fetch - git branch - git branch --remotes - git remote + - run: | + Get-ChildItem env: shell: pwsh - name: Set environment variables uses: deep-mm/set-variables@v1.0 From 60e2d75293e720326b28971c492afb78ad9ec3a5 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 13:32:47 +0100 Subject: [PATCH 14/19] testing dual approach --- .github/workflows/ms.storage.storageaccounts.yml | 2 -- utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 124907e2d2..3d53a0172e 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -118,8 +118,6 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - - run: | - Get-ChildItem env: shell: pwsh - name: Set environment variables uses: deep-mm/set-variables@v1.0 diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 9fff009733..4633814129 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -25,12 +25,13 @@ function Get-ModifiedFileList { [CmdletBinding()] param () - Write-Verbose "Gathering modified files between curent branch and main" -Verbose $CurrentBranch = Get-GitBranchName if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { + Write-Verbose 'Gathering modified files from the pull request' -Verbose $Diff = git diff --name-only --diff-filter=AM $CurrentBranch^..$CurrentBranch } else { - $Diff = git diff --name-only --diff-filter=AM origin/HEAD + Write-Verbose 'Gathering modified files between current branch and main' -Verbose + $Diff = git diff --name-only --diff-filter=AM origin/main } $ModifiedFiles = $Diff | Get-Item -Force From d7e058286a8d27e7e3a7c2c1d5f8a63eaea9f8e5 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Mar 2022 13:38:46 +0100 Subject: [PATCH 15/19] fix --- .github/workflows/ms.storage.storageaccounts.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 3d53a0172e..7481a1516d 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -118,7 +118,6 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - shell: pwsh - name: Set environment variables uses: deep-mm/set-variables@v1.0 with: From 8d367f4b20a46d0f5a04de20a13db9e7f1be261c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 1 Mar 2022 22:35:15 +0100 Subject: [PATCH 16/19] Adding origin and cleaning up function --- .../resourcePublish/Get-ModulesToPublish.ps1 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 4633814129..559f30c113 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -2,16 +2,10 @@ <# .SYNOPSIS -Get modified files between two commits. - -.PARAMETER Commit -Optional. A git reference to base the comparison on. - -.PARAMETER CompareCommit -Optional. A git reference to compare with. +Get modified files between previous and current commit depending on if you are running on main/master or a custom branch. .EXAMPLE -Get-ModifiedFileList -Commit "HEAD^" -CompareCommit "HEAD" +Get-ModifiedFileList Directory: C:\Repo\Azure\ResourceModules\utilities\pipelines\resourcePublish @@ -19,16 +13,14 @@ Mode LastWriteTime Length Name ---- ------------- ------ ---- la--- 08.12.2021 15:50 7133 Script.ps1 -Get modified files between previous and current commit. +Get modified files between previous and current commit depending on if you are running on main/master or a custom branch. #> function Get-ModifiedFileList { - [CmdletBinding()] - param () $CurrentBranch = Get-GitBranchName if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { Write-Verbose 'Gathering modified files from the pull request' -Verbose - $Diff = git diff --name-only --diff-filter=AM $CurrentBranch^..$CurrentBranch + $Diff = git diff --name-only --diff-filter=AM origin/$CurrentBranch^..origin/$CurrentBranch } else { Write-Verbose 'Gathering modified files between current branch and main' -Verbose $Diff = git diff --name-only --diff-filter=AM origin/main From 28f37fb72e935691934277d05580db75ecdb6d4b Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 3 Mar 2022 21:32:17 +0100 Subject: [PATCH 17/19] Fix diff checker for publish --- .../pipelines/resourcePublish/Get-ModulesToPublish.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 index 559f30c113..875d670ea1 100644 --- a/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 +++ b/utilities/pipelines/resourcePublish/Get-ModulesToPublish.ps1 @@ -16,14 +16,17 @@ la--- 08.12.2021 15:50 7133 Script.ps1 Get modified files between previous and current commit depending on if you are running on main/master or a custom branch. #> function Get-ModifiedFileList { - $CurrentBranch = Get-GitBranchName if (($CurrentBranch -eq 'main') -or ($CurrentBranch -eq 'master')) { Write-Verbose 'Gathering modified files from the pull request' -Verbose - $Diff = git diff --name-only --diff-filter=AM origin/$CurrentBranch^..origin/$CurrentBranch + $Diff = git diff --name-only --diff-filter=AM HEAD^ HEAD } else { Write-Verbose 'Gathering modified files between current branch and main' -Verbose $Diff = git diff --name-only --diff-filter=AM origin/main + if ($Diff.count -eq 0) { + Write-Verbose 'Gathering modified files between current branch and master' -Verbose + $Diff = git diff --name-only --diff-filter=AM origin/master + } } $ModifiedFiles = $Diff | Get-Item -Force From 9b4df5c3785c15aac37e2d3cf2255b982d6662ff Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 3 Mar 2022 22:15:10 +0100 Subject: [PATCH 18/19] reset pipelines --- .../ms.storage.storageaccounts.yml | 28 ++-- .../workflows/ms.storage.storageaccounts.yml | 120 +++++++++--------- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml b/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml index 76111f73d9..0dafd10e8b 100644 --- a/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml +++ b/.azuredevops/modulePipelines/ms.storage.storageaccounts.yml @@ -30,21 +30,21 @@ variables: value: '/arm/Microsoft.Storage/storageAccounts' stages: - # - stage: Validation - # displayName: Pester tests - # jobs: - # - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml + - stage: Validation + displayName: Pester tests + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.validateModulePester.yml - # - stage: Deployment - # displayName: Deployment tests - # jobs: - # - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml - # parameters: - # removeDeployment: '${{ parameters.removeDeployment }}' - # deploymentBlocks: - # - path: $(modulePath)/.parameters/min.parameters.json - # - path: $(modulePath)/.parameters/parameters.json - # - path: $(modulePath)/.parameters/v1.parameters.json + - stage: Deployment + displayName: Deployment tests + jobs: + - template: /.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml + parameters: + removeDeployment: '${{ parameters.removeDeployment }}' + deploymentBlocks: + - path: $(modulePath)/.parameters/min.parameters.json + - path: $(modulePath)/.parameters/parameters.json + - path: $(modulePath)/.parameters/v1.parameters.json - stage: Publishing displayName: Publish module diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 7481a1516d..8a267b6516 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -37,71 +37,71 @@ jobs: ############################ # SET INPUT PARAMETERS # ############################ - # job_set_workflow_param: - # runs-on: ubuntu-20.04 - # name: 'Set input parameters to output variables' - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # - name: 'Set input parameters' - # id: get-workflow-param - # uses: ./.github/actions/templates/getWorkflowInput - # with: - # workflowPath: '${{ env.workflowPath}}' - # outputs: - # removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} + job_set_workflow_param: + runs-on: ubuntu-20.04 + name: 'Set input parameters to output variables' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: 'Set input parameters' + id: get-workflow-param + uses: ./.github/actions/templates/getWorkflowInput + with: + workflowPath: '${{ env.workflowPath}}' + outputs: + removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} # #################### # # Pester Tests # # #################### - # job_module_pester_validation: - # runs-on: ubuntu-20.04 - # name: 'Pester tests' - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # - name: 'Run tests' - # uses: ./.github/actions/templates/validateModulePester - # with: - # modulePath: '${{ env.modulePath }}' + job_module_pester_validation: + runs-on: ubuntu-20.04 + name: 'Pester tests' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: 'Run tests' + uses: ./.github/actions/templates/validateModulePester + with: + modulePath: '${{ env.modulePath }}' # #################### # # Deployment tests # # #################### - # job_module_deploy_validation: - # runs-on: ubuntu-20.04 - # name: 'Deployment tests' - # needs: - # - job_set_workflow_param - # - job_module_pester_validation - # strategy: - # fail-fast: false - # matrix: - # parameterFilePaths: - # ['parameters.json', 'min.parameters.json', 'v1.parameters.json'] - # steps: - # - name: 'Checkout' - # uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - # - name: Set environment variables - # uses: deep-mm/set-variables@v1.0 - # with: - # variableFileName: 'global.variables' - # - name: 'Using parameter file [${{ matrix.parameterFilePaths }}]' - # uses: ./.github/actions/templates/validateModuleDeployment - # with: - # templateFilePath: '${{ env.modulePath }}/deploy.bicep' - # parameterFilePath: '${{ env.modulePath }}/.parameters/${{ matrix.parameterFilePaths }}' - # location: '${{ env.defaultLocation }}' - # resourceGroupName: '${{ env.resourceGroupName }}' - # subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' - # managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' - # removeDeployment: '${{ needs.job_set_workflow_param.outputs.removeDeployment }}' + job_module_deploy_validation: + runs-on: ubuntu-20.04 + name: 'Deployment tests' + needs: + - job_set_workflow_param + - job_module_pester_validation + strategy: + fail-fast: false + matrix: + parameterFilePaths: + ['parameters.json', 'min.parameters.json', 'v1.parameters.json'] + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set environment variables + uses: deep-mm/set-variables@v1.0 + with: + variableFileName: 'global.variables' + - name: 'Using parameter file [${{ matrix.parameterFilePaths }}]' + uses: ./.github/actions/templates/validateModuleDeployment + with: + templateFilePath: '${{ env.modulePath }}/deploy.bicep' + parameterFilePath: '${{ env.modulePath }}/.parameters/${{ matrix.parameterFilePaths }}' + location: '${{ env.defaultLocation }}' + resourceGroupName: '${{ env.resourceGroupName }}' + subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' + managementGroupId: '${{ secrets.ARM_MGMTGROUP_ID }}' + removeDeployment: '${{ needs.job_set_workflow_param.outputs.removeDeployment }}' ############### # PUBLISH # @@ -110,9 +110,9 @@ jobs: name: 'Publish module' if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.prerelease == 'true' runs-on: ubuntu-20.04 - # needs: - # - job_set_workflow_param - # - job_module_deploy_validation + needs: + - job_set_workflow_param + - job_module_deploy_validation steps: - name: 'Checkout' uses: actions/checkout@v2 From e693b77f571be2a34327515ae2c47650bcc67605 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 3 Mar 2022 22:17:14 +0100 Subject: [PATCH 19/19] cleanup --- .github/workflows/ms.storage.storageaccounts.yml | 12 ++++++------ .../storageAccounts/fileServices/shares/version.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ms.storage.storageaccounts.yml b/.github/workflows/ms.storage.storageaccounts.yml index 8a267b6516..aeb32ad24f 100644 --- a/.github/workflows/ms.storage.storageaccounts.yml +++ b/.github/workflows/ms.storage.storageaccounts.yml @@ -53,9 +53,9 @@ jobs: outputs: removeDeployment: ${{ steps.get-workflow-param.outputs.removeDeployment }} - # #################### - # # Pester Tests # - # #################### + #################### + # Pester Tests # + #################### job_module_pester_validation: runs-on: ubuntu-20.04 name: 'Pester tests' @@ -69,9 +69,9 @@ jobs: with: modulePath: '${{ env.modulePath }}' - # #################### - # # Deployment tests # - # #################### + #################### + # Deployment tests # + #################### job_module_deploy_validation: runs-on: ubuntu-20.04 name: 'Deployment tests' diff --git a/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json b/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json index badc0a2285..56f8d9ca40 100644 --- a/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json +++ b/arm/Microsoft.Storage/storageAccounts/fileServices/shares/version.json @@ -1,4 +1,4 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.5" + "version": "0.4" }