|
8 | 8 | - group: msixTools |
9 | 9 | - group: 'Azure Blob variable group' |
10 | 10 | - name: ob_outputDirectory |
11 | | - value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT' |
| 11 | + value: '$(Build.ArtifactStagingDirectory)\ONEBRANCH_ARTIFACT' |
12 | 12 |
|
13 | 13 | steps: |
14 | 14 | - download: AIShellPackagePipeline |
@@ -76,39 +76,16 @@ jobs: |
76 | 76 | retryCountOnTaskFailure: 1 |
77 | 77 |
|
78 | 78 | - pwsh: | |
79 | | - $azureRmModule = Get-InstalledModule AzureRM -ErrorAction SilentlyContinue -Verbose |
80 | | - if ($azureRmModule) { |
81 | | - Write-Host 'AzureRM module exists. Removing it' |
82 | | - Uninstall-AzureRm |
83 | | - Write-Host 'AzureRM module removed' |
| 79 | + if (-not (Test-Path '$(ob_outputDirectory)')) { |
| 80 | + New-Item -ItemType Directory -Path '$(ob_outputDirectory)' -Force |
84 | 81 | } |
85 | 82 |
|
86 | | - Install-Module -Name Az.Storage -Force -AllowClobber -Scope CurrentUser -Verbose |
87 | | - displayName: Remove AzRM modules and install Az.Storage |
88 | | -
|
89 | | - - task: AzurePowerShell@5 |
90 | | - displayName: Upload msix to blob |
91 | | - inputs: |
92 | | - azureSubscription: az-blob-cicd-infra |
93 | | - scriptType: inlineScript |
94 | | - azurePowerShellVersion: LatestVersion |
95 | | - pwsh: true |
96 | | - inline: | |
97 | | - $containerName = 'aish' |
98 | | - $storageAccount = '$(PSInfraStorageAccount)' |
99 | | -
|
100 | | - $storageContext = New-AzStorageContext -StorageAccountName $storageAccount -UseConnectedAccount |
101 | | -
|
102 | | - if ($env:BundleDir) { |
103 | | - $bundleFile = (Get-Item "$env:BundleDir\*.msixbundle").FullName |
104 | | - $fileName = $bundleFile | Split-Path -Leaf |
105 | | -
|
106 | | - $version = [System.IO.Path]::GetFileNameWithoutExtension($fileName).Replace('AIShell-', '') |
107 | | - $blobName = "$version/$fileName" |
108 | | -
|
109 | | - Write-Verbose -Verbose "Uploading $bundleFile to $containerName/$blobName" |
110 | | - $null = Set-AzStorageBlobContent -File $bundleFile -Container $containerName -Blob $blobName -Context $storageContext |
111 | | - } |
112 | | - else{ |
113 | | - throw "BundleDir not found" |
114 | | - } |
| 83 | + Write-Verbose -Verbose "Copying msixbundle to output directory" |
| 84 | + if ($env:BundleDir) { |
| 85 | + $bundleFile = (Get-Item "$env:BundleDir\*.msixbundle").FullName |
| 86 | + Copy-Item -Path $bundleFile -Destination '$(ob_outputDirectory)' -Force -Verbose |
| 87 | + } |
| 88 | + else{ |
| 89 | + throw "BundleDir not found" |
| 90 | + } |
| 91 | + displayName: Copy msixbundle to output directory |
0 commit comments