Skip to content

Commit

Permalink
Change storage to drop
Browse files Browse the repository at this point in the history
  • Loading branch information
MSylvia committed Aug 30, 2024
1 parent 622ffc4 commit 049ce7b
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 92 deletions.
2 changes: 0 additions & 2 deletions tools/devops/automation/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ extends:
testConfigurations: ${{ parameters.testConfigurations }}
deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }}
macTestsConfigurations: ${{ parameters.macTestsConfigurations }}
azureStorage: ${{ variables['azureStorage'] }}
azureContainer: ${{ variables['azureContainer'] }}
signingSetupSteps:
- template: ./templates/sign-and-notarized/setup.yml
parameters:
Expand Down
2 changes: 0 additions & 2 deletions tools/devops/automation/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ extends:
testConfigurations: ${{ parameters.testConfigurations }}
deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }}
macTestsConfigurations: ${{ parameters.macTestsConfigurations }}
azureStorage: ${{ variables['azureStorage'] }}
azureContainer: ${{ variables['azureContainer'] }}
signingSetupSteps:
- template: ./templates/sign-and-notarized/setup.yml
parameters:
Expand Down
8 changes: 0 additions & 8 deletions tools/devops/automation/templates/main-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ parameters:
}
]

- name: azureStorage
type: string

- name: azureContainer
type: string

- name: stageDisplayNamePrefix
type: string
default: ''
Expand Down Expand Up @@ -438,8 +432,6 @@ stages:
isPR: ${{ parameters.isPR }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
azureStorage: ${{ parameters.azureStorage }}
azureContainer: ${{ parameters.azureContainer }}
packages: # flatten the pkgs for the parameter
- ${{ each pkg in parameters.legacyPackageJobs }}:
- ${{ pkg }}
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,4 @@ stages:
testConfigurations: ${{ parameters.testConfigurations }}
deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }}
macTestsConfigurations: ${{ parameters.macTestsConfigurations }}
azureStorage: ${{ variables['azureStorage'] }}
azureContainer: ${{ variables['azureContainer'] }}

Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ parameters:
type: string
default: HEAD

- name: azureStorage
type: string

- name: azureContainer
type: string

- name: uploadPrefix
type: string
default: '$(MaciosUploadPrefix)'
Expand Down Expand Up @@ -175,8 +169,6 @@ jobs:
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
sbomFilter: '*.nupkg;*.pkg;*.msi'
azureStorage: ${{ parameters.azureStorage }}
azureContainer: ${{ parameters.azureContainer }}

# Job that runs on a vm that downloads the artifacts information and adds a github comment pointing to the results of the build.
- job: artifacts_github_comment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ parameters:
type: string
default: '*' # Supports multiple filters separated by semi-colon such as *.msi;*.nupkg

- name: azureStorage
type: string

- name: azureContainer
type: string

- name: repositoryAlias
type: string
default: self
Expand Down Expand Up @@ -68,17 +62,28 @@ steps:
displayName: "Show downloaded artifacts"

- pwsh: |
$packagePrefix = "https://dl.internalx.com/$Env:AZURE_CONTAINER/$Env:VIRTUAL_PATH/package"
$DropServiceUrl = "https://devdiv.artifacts.visualstudio.com/DefaultCollection"
$StatusDropUrl = "https://vsdrop.microsoft.com/file/v1"
$BuildShortHash = "$(Build.SourceVersion)".subString(0, 7)
$ProjectPathUrl = "Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$BuildShortHash/$(Build.BuildId)"
$PackagePrefix = "$StatusDropUrl/$ProjectPathUrl/${{ parameters.uploadPrefix }}package"
# Write-Host "##vso[task.setvariable variable=BuildShortHash]$BuildShortHash"
# Write-Host "##vso[task.setvariable variable=DropServiceUrl]$DropServiceUrl"
Write-Host "##vso[task.setvariable variable=ProjectPathUrl]$ProjectPathUrl"
Write-Host "##vso[task.setvariable variable=PackagePrefix]$PackagePrefix"
displayName: "Set drop status URL variables"

- pwsh: |
$files = Get-ChildItem -Path "$(Build.SourcesDirectory)\\artifacts\\${{ parameters.uploadPrefix }}package" -File -Force -Name
$manifestFile = "$(Build.SourcesDirectory)\\artifacts\${{ parameters.uploadPrefix }}package\\manifest"
foreach ($f in $files) {
Add-Content -Path "$manifestFile" -Value "$packagePrefix/$f"
Add-Content -Path "$manifestFile" -Value "$(PackagePrefix);$f"
}
Add-Content -Path "$manifestFile" -Value "$packagePrefix/$artifacts.json"
Add-Content -Path "$manifestFile" -Value "$packagePrefix/manifest"
Add-Content -Path "$manifestFile" -Value "$(PackagePrefix);artifacts.json"
Add-Content -Path "$manifestFile" -Value "$(PackagePrefix);manifest"
env:
VIRTUAL_PATH: $(Build.SourceBranchName)/$(Build.SourceVersion)/$(Build.BuildId)
AZURE_CONTAINER: ${{ parameters.azureContainer }}
displayName: "Build manifest"

# Important needed for the next step
Expand All @@ -87,47 +92,6 @@ steps:
GitHubToken: $(GitHub.Token)
ArtifactDirectory: $(Build.SourcesDirectory)/${{ parameters.uploadPrefix }}package-internal

- task: AzureFileCopy@6
displayName: 'Publish package to Azure'
name: upload
inputs:
SourcePath: $(Build.SourcesDirectory)/artifacts/${{ parameters.uploadPrefix }}package
azureSubscription: 'Azure Releng (7b4817ae-218f-464a-bab1-a9df2d99e1e5)'
Destination: AzureBlob
storage: ${{ parameters.azureStorage }}
ContainerName: ${{ parameters.azureContainer }}
BlobPrefix: $(Build.SourceBranchName)/$(Build.SourceVersion)/$(Build.BuildId)/${{ parameters.uploadPrefix }}package # ideally, we would use a variable for this

- task: AzureFileCopy@6
displayName: 'Publish manifest to Azure'
inputs:
SourcePath: $(Build.SourcesDirectory)/artifacts/${{ parameters.uploadPrefix }}package/manifest
azureSubscription: 'Azure Releng (7b4817ae-218f-464a-bab1-a9df2d99e1e5)'
Destination: AzureBlob
storage: ${{ parameters.azureStorage }}
ContainerName: ${{ parameters.azureContainer }}
BlobPrefix: jenkins/$(Build.SourceBranchName)/$(Build.SourceVersion)

- task: AzureFileCopy@6
displayName: 'Publish manifest to Azure as latest'
inputs:
SourcePath: $(Build.SourcesDirectory)/artifacts/${{ parameters.uploadPrefix }}package/manifest
azureSubscription: 'Azure Releng (7b4817ae-218f-464a-bab1-a9df2d99e1e5)'
Destination: AzureBlob
storage: ${{ parameters.azureStorage }}
ContainerName: ${{ parameters.azureContainer }}
BlobPrefix: jenkins/$(Build.SourceBranchName)/latest

- task: AzureFileCopy@6
displayName: 'Publish manifest to Azure per commit'
inputs:
SourcePath: $(Build.SourcesDirectory)/artifacts/${{ parameters.uploadPrefix }}package/manifest
azureSubscription: 'Azure Releng (7b4817ae-218f-464a-bab1-a9df2d99e1e5)'
Destination: AzureBlob
storage: ${{ parameters.azureStorage }}
ContainerName: ${{ parameters.azureContainer }}
BlobPrefix: jenkins/$(Build.SourceVersion)

- pwsh: |
$execPath="$Env:BUILD_SOURCESDIRECTORY\Xamarin.Build.Tasks\tools\BuildTasks\build-tasks.exe"
Expand All @@ -145,11 +109,12 @@ steps:
$execExpression = (
"$execPath artifacts" +
" -s `"$maciosPath`"" +
" -a $Env:AZURE_STORAGE" +
" -c $Env:STORAGE_PASS" +
" -a AZURE_STORAGE" +
" -c STORAGE_PASS" +
" -u `"$Env:AZURE_CONTAINER/$Env:VIRTUAL_PATH/${{ parameters.uploadPrefix }}package`"" +
" -d `"$(Build.SourcesDirectory)\\artifacts\${{ parameters.uploadPrefix }}package`"" +
" -o `"$(Build.SourcesDirectory)\\artifacts\${{ parameters.uploadPrefix }}package`""
" -o `"$(Build.SourcesDirectory)\\artifacts\${{ parameters.uploadPrefix }}package`"" +
" -x" # Disable Upload
)
Write-Host "Expression is:"
Expand All @@ -159,11 +124,18 @@ steps:
env:
VIRTUAL_PATH: $(Build.SourceBranchName)/$(Build.SourceVersion)/$(Build.BuildId)
GITHUB_AUTH_TOKEN: $(GitHub.Token)
STORAGE_PASS: $(auth-xamarin-bosstoragemirror-account-key)
AZURE_STORAGE: ${{ parameters.azureStorage }}
AZURE_CONTAINER: ${{ parameters.azureContainer }}
displayName: 'Generate artifacts.json'

- task: ms-vscs-artifact.build-tasks.artifactDropTask-1.artifactDropTask@0
displayName: 'Publish package to Azure DevOps'
inputs:
sourcePath: $(Build.SourcesDirectory)/artifacts/${{ parameters.uploadPrefix }}package
dropServiceURI: "https://devdiv.artifacts.visualstudio.com/DefaultCollection"
buildNumber: $(ProjectPathUrl)
dropMetadataContainerName: ${{ parameters.uploadPrefix }}package #TODO
retentionDays: 2 #TODO
toLowerCase: false

# upload the artifacts.json to the build pipeline artifacts so that it can be consumed by other jobs to
# get the required urls
- task: 1ES.PublishPipelineArtifact@1
Expand All @@ -184,7 +156,8 @@ steps:
# the azure step sets the env variable, but it points to the wrong url since it uses the one in bosstorage, we
# need to use the dl version.
$pkgsVirtualUrl = "https://dl.internalx.com/$Env:AZURE_CONTAINER/$Env:VIRTUAL_PATH/${{ parameters.uploadPrefix }}package"
$pkgsVirtualUrl = "$(PackagePrefix)"
Write-Host "Urls is $pkgsVirtualUrl"
$pkgsPath = "$(Build.SourcesDirectory)\\artifacts\\${{ parameters.uploadPrefix }}package"
Expand Down Expand Up @@ -291,7 +264,6 @@ steps:
env:
GITHUB_TOKEN: $(GitHub.Token)
ACCESSTOKEN: $(System.AccessToken)
AZURE_CONTAINER: ${{ parameters.azureContainer }}
VIRTUAL_PATH: $(Build.SourceBranchName)/$(Build.SourceVersion)/$(Build.BuildId)
displayName: 'Set GithubStatus'

Expand Down
6 changes: 0 additions & 6 deletions tools/devops/automation/templates/tests-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,6 @@ parameters:
- name: macTestsConfigurations
type: object

- name: azureStorage
type: string

- name: azureContainer
type: string

- name: stageDisplayNamePrefix
type: string
default: ''
Expand Down
4 changes: 0 additions & 4 deletions tools/devops/automation/templates/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ variables:
value: 'https://devdiv.visualstudio.com/_settings/agentpools?poolId=367&view=agents'
- name: CIBuild
value: true
- name: azureStorage
value: 'bosstoragemirror'
- name: azureContainer
value: 'wrench'
- name: BUILD_REVISION
value: azure-devops-$(Build.SourceVersion)
- name: MacPoolAccessToken
Expand Down

9 comments on commit 049ce7b

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11) passed 💻

All tests on macOS M1 - Mac Big Sur (11) passed.

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

6 tests crashed, 0 tests failed, 82 tests passed.

Failures

❌ dotnettests tests (Multiple platforms)

🔥 Failed catastrophically on VSTS: test results - dotnettests_multiple (no summary found).

Html Report (VSDrops) Download

❌ framework tests

🔥 Failed catastrophically on VSTS: test results - framework (no summary found).

Html Report (VSDrops) Download

❌ fsharp tests

🔥 Failed catastrophically on VSTS: test results - fsharp (no summary found).

Html Report (VSDrops) Download

❌ linker tests

🔥 Failed catastrophically on VSTS: test results - linker (no summary found).

Html Report (VSDrops) Download

❌ mac-binding-project tests

🔥 Failed catastrophically on VSTS: test results - mac-binding-project (no summary found).

Html Report (VSDrops) Download

❌ mononative tests

🔥 Failed catastrophically on VSTS: test results - mononative (no summary found).

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ install-source: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 7 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (watchOS): All 4 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Build failed 🔥

Build failed for the job 'Build packages'

Pipeline on Agent
Hash: 049ce7b6e7fe1990adbb61319ba0f2b70e912c29 [CI build]

Please sign in to comment.