From 3a2735c2d0013d5a8c13a08ef5d204061bc288c6 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Thu, 5 Nov 2020 13:47:40 -0800 Subject: [PATCH] Fixed the test-path and yaml files (#17175) --- eng/docgeneration/Generate-DocIndex.ps1 | 6 +- eng/docgeneration/service-mapper.json | 132 ------------------------ eng/pipelines/docindex.yml | 49 ++++++--- 3 files changed, 39 insertions(+), 148 deletions(-) delete mode 100644 eng/docgeneration/service-mapper.json diff --git a/eng/docgeneration/Generate-DocIndex.ps1 b/eng/docgeneration/Generate-DocIndex.ps1 index 4e5c8321daee1..293e3d2f3609d 100644 --- a/eng/docgeneration/Generate-DocIndex.ps1 +++ b/eng/docgeneration/Generate-DocIndex.ps1 @@ -3,7 +3,8 @@ Param ( $DocFx, $RepoRoot, - $DocGenDir + $DocGenDir, + $DocOutDir = "${RepoRoot}/docfx_project" ) . "${PSScriptRoot}\..\common\scripts\common.ps1" $GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex" @@ -95,7 +96,6 @@ function Get-TocMapping { function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) { LogDebug "Start generating the docfx toc and build docfx site..." - $DocOutDir = "${RepoRoot}/docfx_project" LogDebug "Initializing Default DocFx Site..." & $($DocFx) init -q -o "${DocOutDir}" @@ -140,7 +140,7 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) { Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutDir}/_site/" -Force } -if ((Get-ChildItem -Path Function: | ? { $_.Name -eq $GetGithubIoDocIndexFn }).Count -gt 0) +if (Test-Path "function:$GetGithubIoDocIndexFn") { &$GetGithubIoDocIndexFn } diff --git a/eng/docgeneration/service-mapper.json b/eng/docgeneration/service-mapper.json deleted file mode 100644 index dbe1790070671..0000000000000 --- a/eng/docgeneration/service-mapper.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "advisor": "Advisor", - "analysisservices": "Analysis Services", - "anomalydetector": "Anomaly Detector", - "apimanagement": "Api Management", - "appconfiguration": "App Configuration", - "applicationinsights": "Application Insights", - "appplatform": "App Platform", - "appservice": "App Service", - "authorization": "Authorization", - "automation": "Automation", - "azurestack": "Azure Stack", - "batch": "Batch", - "batchai": "Batch AI", - "billing": "Billing", - "botservice": "Bot Service", - "cdn": "CDN", - "cognitiveservices": "Cognitive Services", - "commerce": "Commerce", - "commuincation": "Commuincation", - "compute": "Compute", - "consumption": "Consumption", - "containerinstance": "Container Instance", - "containerregistry": "Container Registry", - "containerservice": "Container Service", - "core": "Core", - "cosmos": "Cosmos", - "cosmosdb": "Cosmos DB", - "costmanagement":"Cost Management", - "customer-insights": "Customer Insights", - "databox": "Data Box", - "databricks": "Databricks", - "datacatalog": "Data Catalog", - "datafactory": "Data Factory", - "datalakeanalytics":"Data Lake Analytics", - "datalakestore":"Data Lake Store", - "datamigration": "Database Migration", - "deploymentmanager": "Deployment Manager", - "deviceprovisioningservices": "Device Provisioning Services", - "devspaces": "Dev Spaces", - "devtestlabs": "DevTest Labs", - "dns": "DNS", - "domainservices": "Domain Services", - "edgegateway": "Edge Gateway", - "eventgrid": "Event Grid", - "eventhubs": "Event Hubs", - "features": "Features", - "formrecognizer": "Form Recognizer", - "frontdoor": "Front Door", - "graphrbac": "Graph RBAC", - "hanaonazure": "HANA on Azure", - "hdinsight": "HDInsight", - "identity": "Identity", - "iotcentral": "IoT Central", - "iothub": "IoT Hub", - "iotspaces": "IoT Spaces", - "keyvault": "Key Vault", - "kusto": "Kusto", - "labservices": "Lab Services", - "links": "Links", - "locks": "Locks", - "logic": "Logic", - "loganalytics":"Log Analytics", - "machinelearning": "Machine Learning", - "machinelearningcompute": "Machine Learning Compute", - "machinelearningexperimentation": "Machine Learning Experimentation", - "machinelearningservices": "Machine Learning Services", - "maintenance": "Maintenance", - "managedapplications": "Managed Applications", - "managementgroups": "Management Groups", - "managementpartner": "Management Partner", - "maps": "Maps", - "mariadb": "MariaDB", - "marketplaceordering": "Marketplace Ordering", - "mediaservices": "Media Services", - "migrate": "Migrate", - "mixedreality": "Mixed Reality", - "monitor": "Monitor", - "msi": "MSI", - "mysql": "MySQL", - "netapp": "NetApp", - "network": "Network", - "notificationhubs": "Notification Hubs", - "operationalinsights": "Operational Insights", - "operationsmanagement": "Operations Management", - "peering": "Peering", - "policy": "Policy", - "policyinsights": "Policy Insights", - "postgresql": "PostgreSQL", - "powerbidedicated": "PowerBI Dedicated", - "powerbiembedded": "PowerBI Embedded", - "privatedns": "Private DNS", - "recoveryservices": "Recovery Services", - "recoveryservices.backup": "Recovery Services Backup", - "recoveryservices.siterecovery": "Recovery Services Site Recovery", - "redis": "Redis", - "relay": "Relay", - "reservations": "Reservations", - "resourcegraph": "Resource Graph", - "resourcehealth": "Resource Health", - "resources": "Resources", - "resourcemanager": "Resource Manager", - "schemaregistry": "Schema Registry", - "search": "Search", - "security": "Security", - "serialconsole": "Serial Console", - "service-map": "Service Map", - "servicebus": "Service Bus", - "servicefabric": "Service Fabric", - "servicefabricmesh": "Service Fabric Mesh", - "signalr": "SignalR", - "spring": "Spring Boot", - "sql": "SQL", - "sqlvirtualmachine": "SQL Virtual Machine", - "storage": "Storage", - "storagecache": "Storage Cache", - "storageimportexport": "Storage Import Export", - "storagesync": "Storage Sync", - "storsimple1200series": "Storsimple 1200 Series", - "storsimple8000series": "Storsimple 8000 Series", - "streamanalytics": "Stream Analytics", - "subscription": "Subscription", - "synapse": "Synapse", - "tables": "Tables", - "template": "Template", - "test-utils": "Test Utils", - "textanalytics": "Text Analytics", - "timeseriesinsights": "Time Series Insights", - "trafficmanager": "Traffic Manager", - "visualstudio": "Visual Studio", - "vmwarecloudsimple": "VMware CloudSimple" -} diff --git a/eng/pipelines/docindex.yml b/eng/pipelines/docindex.yml index 0fa45efa9a207..2f70c32db480a 100644 --- a/eng/pipelines/docindex.yml +++ b/eng/pipelines/docindex.yml @@ -13,10 +13,9 @@ jobs: - pwsh: | Invoke-WebRequest -Uri "https://github.com/dotnet/docfx/releases/download/v2.43.2/docfx.zip" ` -OutFile "docfx.zip" | Wait-Process; Expand-Archive -Path "docfx.zip" -DestinationPath ./docfx - echo "##vso[task.setvariable variable=docfxPath;isOutput=true]$(Build.SourcesDirectory)/docfx/docfx.exe" - workingDirectory: $(Build.SourcesDirectory) + echo "##vso[task.setvariable variable=docfxPath]$(Build.BinariesDirectory)/docfx/docfx.exe" + workingDirectory: $(Build.BinariesDirectory) displayName: Download and Extract DocFX - name: setupDocfxTool - task: PowerShell@2 displayName: 'Generate Doc Index' @@ -24,9 +23,10 @@ jobs: pwsh: true filePath: $(Build.SourcesDirectory)/eng/docgeneration/Generate-DocIndex.ps1 arguments: > - -Docfx $(setupDocfxTool.docfxPath) + -Docfx $(docfxPath) -RepoRoot $(Build.SourcesDirectory) -DocGenDir "$(Build.SourcesDirectory)/eng/docgeneration" + -DocOutDir "$(Build.ArtifactStagingDirectory)/docfx_project" -verbose - task: UsePythonVersion@0 @@ -35,16 +35,39 @@ jobs: versionSpec: '3.6' - template: /eng/common/pipelines/templates/steps/mashup-doc-index.yml parameters: - SourceDirectory: $(Build.SourcesDirectory) - - task: CopyFiles@2 - displayName: Copy HTML to Artifacts Directory - inputs: - sourceFolder: $(Build.SourcesDirectory)/docfx_project/ - content: '**\*' - targetFolder: $(Build.ArtifactStagingDirectory)/docfx_project - overWrite: true + SourceDirectory: $(Build.ArtifactStagingDirectory) + - pwsh: | + Copy-Item -Path $(Build.SourcesDirectory)/eng/* -Destination ./ -Recurse -Force + echo "##vso[task.setvariable variable=toolPath]$(Build.BinariesDirectory)" + workingDirectory: $(Build.BinariesDirectory) + displayName: Move eng/common to Tool Directory + - task: PublishPipelineArtifact@0 condition: succeeded() inputs: artifactName: "Doc.Index" - targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site \ No newline at end of file + targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site + + - pwsh: | + git checkout -b gh-pages-local --track origin/gh-pages-root + workingDirectory: $(Build.SourcesDirectory) + displayName: Git pull GH pages branch + + - pwsh: | + Copy-Item -Path $(Build.ArtifactStagingDirectory)/docfx_project/_site/* -Destination ./ -Recurse -Force + git add -A + workingDirectory: $(Build.SourcesDirectory) + displayName: Copy the latest changes + + - task: PowerShell@2 + displayName: Push the Docs to GH-Pages + condition: succeeded() + inputs: + pwsh: true + workingDirectory: $(Build.SourcesDirectory) + filePath: $(toolPath)/common/scripts/git-branch-push.ps1 + arguments: > + -PRBranchName "gh-pages" + -CommitMsg "Auto-generated docs from SHA(s) $(Build.SourceVersion)" + -GitUrl "https://$(azuresdk-github-pat)@github.com/$(Build.Repository.Name).git" + -PushArgs "--force" \ No newline at end of file