From 2be3b3acfa285ff1f5c925a10c9af680514555b3 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 3 Dec 2020 12:25:30 +0100 Subject: [PATCH 1/2] removed superfluous step and some filters --- CI/AZ_MainPipeline.yml | 18 ------------------ tSQLt.code-workspace | 3 ++- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/CI/AZ_MainPipeline.yml b/CI/AZ_MainPipeline.yml index 0e5d1a2a0..d256c91e3 100644 --- a/CI/AZ_MainPipeline.yml +++ b/CI/AZ_MainPipeline.yml @@ -92,7 +92,6 @@ stages: inputs: azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' KeyVaultName: 'tSQLtSigningKey' - SecretsFilter: '*' - task: PowerShell@2 name: Install_tSQLt_OfficialSigningKey @@ -119,22 +118,6 @@ stages: TargetFolder: '$(Build.ArtifactStagingDirectory)/tSQLtCLR' flattenFolders: true - - - task: authenticode-sign@4 - condition: false - inputs: - filePath: 'tSQLt*.dll' - signRootPath: '$(Build.ArtifactStagingDirectory)/tSQLtCLR' - timestampServer: 'http://timestamp.digicert.com' - timestampAlgo: 'sha256' - timestampServerDelay: '15' - fileAlgo: 'sha256' - retryCount: '5' - certificateLocation: 'pfxFile' - pfxFile: '$(CertificatePath)' - pfxPassword: '$(tSQLtSigningKeyPassword)' - additionalArguments: '/debug' - - task: ArchiveFiles@2 inputs: rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/tSQLtCLR' @@ -298,7 +281,6 @@ stages: inputs: azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' KeyVaultName: 'tSQLtSigningKey' - SecretsFilter: '*' - task: AzurePowerShell@4 name: CreateVMAndMore diff --git a/tSQLt.code-workspace b/tSQLt.code-workspace index e228cfdd9..07f82761d 100644 --- a/tSQLt.code-workspace +++ b/tSQLt.code-workspace @@ -5,6 +5,7 @@ } ], "settings": { - "powershell.codeFormatting.addWhitespaceAroundPipe": true + "powershell.codeFormatting.addWhitespaceAroundPipe": true, + "yaml.schemaStore.enable": false } } \ No newline at end of file From e90453b80bac4eb5a59dc29b5809250fcb5f1f2b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 3 Dec 2020 12:32:51 +0100 Subject: [PATCH 2/2] moved artifact steps to before VM creation --- CI/AZ_MainPipeline.yml | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/CI/AZ_MainPipeline.yml b/CI/AZ_MainPipeline.yml index d256c91e3..7641a6711 100644 --- a/CI/AZ_MainPipeline.yml +++ b/CI/AZ_MainPipeline.yml @@ -282,6 +282,40 @@ stages: azureSubscription: 'tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)' KeyVaultName: 'tSQLtSigningKey' + - checkout: tSQLtArtifacts + clean: true + fetchDepth: $(GitFetchDepth) + lfs: false + persistCredentials: true + path: tSQLtArtifacts + + - task: PowerShell@2 + name: GetArtifact + inputs: + targetType: 'inline' + script: | + $ArtifactTargetPath= '$(Pipeline.Workspace)/tSQLt/Build_Artifact' + $CheckIfGitOk = {param($isOk);if(-not $isOk){Write-Host "##vso[task.logissue type=error]GIT Failed!";throw "GIT Failed!"}}; + + Set-Location "$(Pipeline.Workspace)\tSQLtArtifacts\"; + + Write-Host ("ArtifactBranchName: {0}" -f "$(ArtifactBranchName)"); + try{ + git status + git remote show origin + + git switch "$(ArtifactBranchName)" + $CheckIfGitOk.invoke($?); + + git status + }catch{ + throw "Git Failed. See prior errors."; + } + + New-Item -Path $ArtifactTargetPath -ItemType directory -Force + + Copy-Item -Path "*" -Verbose -Destination $ArtifactTargetPath + - task: AzurePowerShell@4 name: CreateVMAndMore env: @@ -339,40 +373,6 @@ stages: ##--##--##--##--##--##--##--##--##--##---##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##---##--##--##--##--##--##--##--##--##--## - - checkout: tSQLtArtifacts - clean: true - fetchDepth: $(GitFetchDepth) - lfs: false - persistCredentials: true - path: tSQLtArtifacts - - - task: PowerShell@2 - name: GetArtifact - inputs: - targetType: 'inline' - script: | - $ArtifactTargetPath= '$(Pipeline.Workspace)/tSQLt/Build_Artifact' - $CheckIfGitOk = {param($isOk);if(-not $isOk){Write-Host "##vso[task.logissue type=error]GIT Failed!";throw "GIT Failed!"}}; - - Set-Location "$(Pipeline.Workspace)\tSQLtArtifacts\"; - - Write-Host ("ArtifactBranchName: {0}" -f "$(ArtifactBranchName)"); - try{ - git status - git remote show origin - - git switch "$(ArtifactBranchName)" - $CheckIfGitOk.invoke($?); - - git status - }catch{ - throw "Git Failed. See prior errors."; - } - - New-Item -Path $ArtifactTargetPath -ItemType directory -Force - - Copy-Item -Path "*" -Verbose -Destination $ArtifactTargetPath - - task: PowerShell@2 name: GetVariablesInPlace inputs: