Skip to content

Commit

Permalink
Fixed the test-path and yaml files (Azure#17175)
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored Nov 5, 2020
1 parent 2383dfc commit 3a2735c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 148 deletions.
6 changes: 3 additions & 3 deletions eng/docgeneration/Generate-DocIndex.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Param (
$DocFx,
$RepoRoot,
$DocGenDir
$DocGenDir,
$DocOutDir = "${RepoRoot}/docfx_project"
)
. "${PSScriptRoot}\..\common\scripts\common.ps1"
$GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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
}
Expand Down
132 changes: 0 additions & 132 deletions eng/docgeneration/service-mapper.json

This file was deleted.

49 changes: 36 additions & 13 deletions eng/pipelines/docindex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ 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'
inputs:
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
Expand All @@ -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
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"

0 comments on commit 3a2735c

Please sign in to comment.