Skip to content

Commit

Permalink
(docs): fix implementation issues with deployment and publish artifac…
Browse files Browse the repository at this point in the history
…t pipeline (microsoft#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).
  • Loading branch information
zhenmichael authored Nov 21, 2024
1 parent 645a1a0 commit 8dd510a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 45 deletions.
6 changes: 1 addition & 5 deletions tools/pipelines/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -105,7 +102,6 @@ stages:

- job: build_site
displayName: 'Build website'
dependsOn: upload_json
pool: Large-eastus2
steps:
- checkout: self
Expand Down
12 changes: 6 additions & 6 deletions tools/pipelines/publish-api-model-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) }}:
Expand Down Expand Up @@ -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:
Expand All @@ -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'
Expand Down
39 changes: 5 additions & 34 deletions tools/pipelines/templates/upload-json-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8dd510a

Please sign in to comment.