From 8dd510a5b0a41ad5cb4a17f189db7dc563a0397c Mon Sep 17 00:00:00 2001 From: Michael Zhen <112977307+zhenmichael@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:50:48 -0800 Subject: [PATCH] (docs): fix implementation issues with deployment and publish artifact pipeline (#23171) Corrected errors from previous imlementation of deploy-website, upload-json-steps, and publish-api-model-artifact pipelines. Also removed unused pipeline artifact downloads in upload-json-steps (only downloading from client build now). --- tools/pipelines/deploy-website.yml | 6 +-- .../pipelines/publish-api-model-artifact.yml | 12 +++--- .../pipelines/templates/upload-json-steps.yml | 39 +++---------------- 3 files changed, 12 insertions(+), 45 deletions(-) diff --git a/tools/pipelines/deploy-website.yml b/tools/pipelines/deploy-website.yml index 069bb9729751..8cf3b44c7e2c 100644 --- a/tools/pipelines/deploy-website.yml +++ b/tools/pipelines/deploy-website.yml @@ -47,10 +47,7 @@ variables: - name: repoToTrigger value: microsoft/FluidFramework - name: shouldRetainGuardianAssets - value: ${{ or( - eq(parameters.guardianAssetRetentionOverride, 'force'), - and(eq(parameters.guardianAssetRetentionOverride, 'default')) - )}} + value: ${{ eq(parameters.guardianAssetRetentionOverride, 'default') }} - name: deploymentToken ${{ if eq( parameters['deployEnvironment'], 'new' ) }}: value: "$(FLUID_WEBSITE_TORUS_API_TOKEN)" @@ -105,7 +102,6 @@ stages: - job: build_site displayName: 'Build website' - dependsOn: upload_json pool: Large-eastus2 steps: - checkout: self diff --git a/tools/pipelines/publish-api-model-artifact.yml b/tools/pipelines/publish-api-model-artifact.yml index 11e36f37dc95..5595ec4a1d90 100644 --- a/tools/pipelines/publish-api-model-artifact.yml +++ b/tools/pipelines/publish-api-model-artifact.yml @@ -66,7 +66,7 @@ variables: - name: shouldRetainGuardianAssets value: ${{ or( eq(parameters.guardianAssetRetentionOverride, 'force'), - and(eq(parameters.guardianAssetRetentionOverride, 'default')) + eq(parameters.guardianAssetRetentionOverride, 'default') )}} - name: deploymentToken ${{ if eq( parameters['deployEnvironment'], 'new' ) }}: @@ -128,12 +128,12 @@ stages: - deployment: upload_json displayName: 'Combine api-extractor JSON' - dependsOn: [] # run in parallel + dependsOn: check_branch_version environment: 'fluid-docs-env' pool: Large variables: - uploadAsLatestRelease: $[ stageDependencies.check_branch_version.outputs['check_branch_version.SetShouldDeploy.shouldDeploy'] ] - majorVersion: $[ stageDependencies.check_branch_version.outputs['check_branch_version.SetVersion.majorVersion'] ] + uploadAsLatestRelease: $[ dependencies.check_branch_version.outputs['SetShouldDeploy.shouldDeploy'] ] + majorVersion: $[ dependencies.check_branch_version.outputs['SetShouldDeploy.majorVersion'] ] strategy: runOnce: deploy: @@ -149,10 +149,10 @@ stages: # this stage runs depending on the check_branch_version stage and deployOverride parameter # the trigger is configured such that deploy-website runs using main branch resources # this ensures that the generated website is up-to-date with the latest changes -- stage: deploy docs +- stage: deploy displayName: 'Deploy website' pool: Small - dependsOn: ['build', 'guardian', 'check_branch_version'] + dependsOn: ['check_branch_version'] jobs: - job: deploy_site displayName: 'Deploy website' diff --git a/tools/pipelines/templates/upload-json-steps.yml b/tools/pipelines/templates/upload-json-steps.yml index ad3651bbbd7d..5fa81c46b6ab 100644 --- a/tools/pipelines/templates/upload-json-steps.yml +++ b/tools/pipelines/templates/upload-json-steps.yml @@ -16,8 +16,11 @@ parameters: # Determines if artifact should be published as latest-v*.tar.gz (for release branches) - name: uploadAsLatestRelease - type: boolean + type: string default: false + values: + - true + - false # Major version to upload as latest-v*.tar.gz - name: majorVersion @@ -29,42 +32,10 @@ steps: clean: true # Download the api-extractor outputs -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - common-definitions - branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - common-utils - branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - container-definitions - branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - core-interfaces - branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - driver-definitions - branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - protocol-definitions - branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: Build - azure - branchName: ${{ variables['Build.SourceBranch'] }} - template: download-api-extractor-artifact.yml parameters: pipelineName: Build - client packages branchName: ${{ variables['Build.SourceBranch'] }} -- template: download-api-extractor-artifact.yml - parameters: - pipelineName: server-routerlicious - branchName: ${{ variables['Build.SourceBranch'] }} # Copy and merge the api-extractor outputs to a central location - task: CopyFiles@2 @@ -116,7 +87,7 @@ steps: inlineScript: | az storage blob upload -f '$(Pipeline.Workspace)/$(Build.SourceVersion).tar.gz' -c 'api-extractor-json' -n latest.tar.gz --account-name ${{ parameters.STORAGE_ACCOUNT }} --auth-mode login --overwrite --verbose -- ${{ if eq(parameters.uploadAsLatestRelease, true) }}: +- ${{ if eq(parameters.uploadAsLatestRelease, 'true') }}: - task: AzureCLI@2 displayName: 'Upload JSON as latest-v*.tar.gz' continueOnError: true