From 62f0ffc1fd886f80e8355f14cd8717629b84e89b Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Fri, 13 Sep 2024 12:17:05 -0400 Subject: [PATCH] ci(v8 release): migrate v8 docsite release to yaml (#32820) --- .devops/templates/publish-website.yml | 50 +++++++++++++++++++++++++++ azure-pipelines.release.yml | 10 ++++++ 2 files changed, 60 insertions(+) create mode 100644 .devops/templates/publish-website.yml diff --git a/.devops/templates/publish-website.yml b/.devops/templates/publish-website.yml new file mode 100644 index 0000000000000..9dae51b47ff6b --- /dev/null +++ b/.devops/templates/publish-website.yml @@ -0,0 +1,50 @@ +parameters: + - name: version + type: string + default: 8 + +steps: + - task: AzureCLI@2 + displayName: 'Copy website drop to Azure' + inputs: + azureSubscription: 'Azure - fabricweb storage - NEW' + scriptType: 'bash' + scriptLocation: inlineScript + inlineScript: | + az storage blob upload-batch \ + --destination 'fabric-website' \ + --source $(System.DefaultWorkingDirectory)/apps/public-docsite/dist \ + --account-name fabricweb \ + --destination-path v${{ parameters.version }}/$(Build.BuildNumber)/ \ + --auth-mode login \ + --overwrite + + - task: AzureCLI@2 + displayName: 'Update dogfood manifest in Azure blob' + inputs: + azureSubscription: 'Azure - fabricweb storage - NEW' + scriptType: 'bash' + scriptLocation: inlineScript + inlineScript: | + az storage blob upload \ + --account-name fabricweb \ + --container-name fabric-website \ + --name manifests/v${{ parameters.version }}-df.js \ + --file $(System.DefaultWorkingDirectory)/site-manifests/v${{ parameters.version }}-df.js \ + --auth-mode login \ + --overwrite + + - task: AzureCLI@2 + displayName: 'Update prod manifest in Azure blob' + inputs: + azureSubscription: 'Azure - fabricweb storage - NEW' + scriptType: 'bash' + scriptLocation: inlineScript + inlineScript: | + az storage blob upload \ + --account-name fabricweb \ + --container-name fabric-website \ + --name manifests/v${{ parameters.version }}-prod.js \ + --file $(System.DefaultWorkingDirectory)/site-manifests/v${{ parameters.version }}-prod.js \ + --auth-mode login \ + --overwrite diff --git a/azure-pipelines.release.yml b/azure-pipelines.release.yml index 235fd9b16e8ff..63e83e912566e 100644 --- a/azure-pipelines.release.yml +++ b/azure-pipelines.release.yml @@ -13,6 +13,10 @@ variables: - name: tags value: production,externalfacing +# below are variables configurable at queue time, so they cannot appear in yml file +# - name: skipPublish # set it to true in order to skip publishing to NPM. Useful for deploying docsite only updates. +# value: false + schedules: # minute 0, hour 7 in UTC (11pm in UTC-8), any day of month, any month, days 1-5 of week (M-F) # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?tabs=yaml&view=azure-devops#supported-cron-syntax @@ -124,6 +128,7 @@ extends: - script: | yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-v8.config.js --message 'release: applying package updates - react v8' git reset --hard origin/master + condition: eq(variables.skipPublish, false) env: GITHUB_PAT: $(githubPAT) displayName: Publish changes and bump versions @@ -154,10 +159,15 @@ extends: node ./packages/public-docsite-setup/scripts/generateHomepage ./homepage displayName: 'Generate homepage.htm' + - template: .devops/templates/publish-website.yml@self + parameters: + version: 8 + # Run this near the end because it's more likely to fail than the artifact upload tasks, and its # failure doesn't need to block anything else - script: | node -r ./scripts/ts-node/src/register ./scripts/update-release-notes/src/index.ts --token=$(githubPAT) --apply --debug + condition: eq(variables.skipPublish, false) displayName: 'Update github release notes' - template: .devops/templates/cleanup.yml@self