@@ -282,6 +282,40 @@ stages:
282282 azureSubscription : ' tSQLt CI Subscription(58c04a99-5b92-410c-9e41-10262f68ca80)'
283283 KeyVaultName : ' tSQLtSigningKey'
284284
285+ - checkout : tSQLtArtifacts
286+ clean : true
287+ fetchDepth : $(GitFetchDepth)
288+ lfs : false
289+ persistCredentials : true
290+ path : tSQLtArtifacts
291+
292+ - task : PowerShell@2
293+ name : GetArtifact
294+ inputs :
295+ targetType : ' inline'
296+ script : |
297+ $ArtifactTargetPath= '$(Pipeline.Workspace)/tSQLt/Build_Artifact'
298+ $CheckIfGitOk = {param($isOk);if(-not $isOk){Write-Host "##vso[task.logissue type=error]GIT Failed!";throw "GIT Failed!"}};
299+
300+ Set-Location "$(Pipeline.Workspace)\tSQLtArtifacts\";
301+
302+ Write-Host ("ArtifactBranchName: {0}" -f "$(ArtifactBranchName)");
303+ try{
304+ git status
305+ git remote show origin
306+
307+ git switch "$(ArtifactBranchName)"
308+ $CheckIfGitOk.invoke($?);
309+
310+ git status
311+ }catch{
312+ throw "Git Failed. See prior errors.";
313+ }
314+
315+ New-Item -Path $ArtifactTargetPath -ItemType directory -Force
316+
317+ Copy-Item -Path "*" -Verbose -Destination $ArtifactTargetPath
318+
285319 - task : AzurePowerShell@4
286320 name : CreateVMAndMore
287321 env :
@@ -339,40 +373,6 @@ stages:
339373# #--##--##--##--##--##--##--##--##--##---##--##--##--##--##--##--##--##--##--##
340374# #--##--##--##--##--##--##--##--##--##---##--##--##--##--##--##--##--##--##--##
341375
342- - checkout : tSQLtArtifacts
343- clean : true
344- fetchDepth : $(GitFetchDepth)
345- lfs : false
346- persistCredentials : true
347- path : tSQLtArtifacts
348-
349- - task : PowerShell@2
350- name : GetArtifact
351- inputs :
352- targetType : ' inline'
353- script : |
354- $ArtifactTargetPath= '$(Pipeline.Workspace)/tSQLt/Build_Artifact'
355- $CheckIfGitOk = {param($isOk);if(-not $isOk){Write-Host "##vso[task.logissue type=error]GIT Failed!";throw "GIT Failed!"}};
356-
357- Set-Location "$(Pipeline.Workspace)\tSQLtArtifacts\";
358-
359- Write-Host ("ArtifactBranchName: {0}" -f "$(ArtifactBranchName)");
360- try{
361- git status
362- git remote show origin
363-
364- git switch "$(ArtifactBranchName)"
365- $CheckIfGitOk.invoke($?);
366-
367- git status
368- }catch{
369- throw "Git Failed. See prior errors.";
370- }
371-
372- New-Item -Path $ArtifactTargetPath -ItemType directory -Force
373-
374- Copy-Item -Path "*" -Verbose -Destination $ArtifactTargetPath
375-
376376 - task : PowerShell@2
377377 name : GetVariablesInPlace
378378 inputs :
0 commit comments