From 02de60b8959532ca856a2c75cfe22fa76bdc13c5 Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 13 Apr 2021 15:34:55 -0700 Subject: [PATCH 01/14] Update doc check to copy paste entire site --- build/templates/template-checkdocs.yml | 41 ++++++++++++++++++++------ 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index 75bc519e..5b15f4a7 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + # Runs mkdocs to check if docs need updating on gh-pages. # Core and Client projects must be built for it to detect API changes. steps: @@ -6,24 +9,44 @@ steps: mkdir $(Build.ArtifactStagingDirectory)\Patch pip install --upgrade pip --upgrade -r $(FORepoRoot)\docs\requirements.txt mkdocs build --clean --config-file $(FORepoRoot)\docs\mkdocs.yml + displayName: 'Build website' +- pwsh: | + # checkout gh-pages git reset HEAD --hard git fetch git checkout gh-pages - robocopy $(FORepoRoot)\docs\site\ $(FORepoRoot)\ /S + + # backup new website + Compress-Archive -Path $(FORepoRoot)/docs/site/* -DestinationPath $(Build.ArtifactStagingDirectory)/gh-pages/gh-pages.zip -Force + + # wipe subfolders, to ensure we also catch page and media deletions + get-childitem $(FORepoRoot) -Directory | remove-item -recurse -force + + # copy new website build to repro root + Expand-Archive -Path $(Build.ArtifactStagingDirectory)\gh-pages\gh-pages.zip -DestinationPath $(FORepoRoot) -Force + + # restore sitemap.xml, as it has a timestamp that changes on build git restore sitemap.xml* + + # add all files and check for changes git add -A - git status > $(Build.ArtifactStagingDirectory)\Patch\GitStatus.txt - git diff --cached --exit-code > $(Build.ArtifactStagingDirectory)\Patch\GitDiff.txt + git status > $(Build.ArtifactStagingDirectory)\GitOutput\GitStatus.txt + git diff --cached --exit-code > $(Build.ArtifactStagingDirectory)\GitOutput\GitDiff.txt echo ##vso[task.setvariable variable=hasChanges]%errorlevel% - git diff --cached > $(Build.ArtifactStagingDirectory)\Patch\UpdatedDocs.patch - displayName: 'Build website and check for changes' + displayName: 'Check website for changes' - task: PublishPipelineArtifact@1 - displayName: 'Publish patch file as artifact if website has changes' + displayName: 'Publish git output artifact if website has changes' condition: eq(variables['hasChanges'], '1') inputs: - artifactName: UpdatedDocsPatch - targetPath: $(Build.ArtifactStagingDirectory)\Patch + artifactName: GitOutput + targetPath: $(Build.ArtifactStagingDirectory)\GitOutput +- task: PublishPipelineArtifact@1 + displayName: 'Publish gh-pages artifact if website has changes' + condition: eq(variables['hasChanges'], '1') + inputs: + artifactName: GitOutput + targetPath: $(Build.ArtifactStagingDirectory)\gh-pages - script: | - echo ##vso[task.logissue type=warning]gh-pages documentation needs updating! Use the published UpdatedDocsPatch artifact to update the gh-pages branch after this PR is completed. + echo ##vso[task.logissue type=warning]gh-pages documentation needs updating! Use the published gh-pages artifact from the CI build to update the gh-pages branch. displayName: 'Warn if website has changes' condition: eq(variables['hasChanges'], '1') From afc76c1460c9bcf6482435a7ae51853f9de4b324 Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Mon, 19 Apr 2021 16:55:25 -0700 Subject: [PATCH 02/14] create dir --- build/templates/template-checkdocs.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index 5b15f4a7..2c597ed9 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -16,6 +16,11 @@ steps: git fetch git checkout gh-pages + if ((Test-Path "$(Build.ArtifactStagingDirectory)/gh-pages") -eq $false) + { + $null = New-Item -Path "$(Build.ArtifactStagingDirectory)/gh-pages" -ItemType Directory + } + # backup new website Compress-Archive -Path $(FORepoRoot)/docs/site/* -DestinationPath $(Build.ArtifactStagingDirectory)/gh-pages/gh-pages.zip -Force @@ -44,7 +49,7 @@ steps: displayName: 'Publish gh-pages artifact if website has changes' condition: eq(variables['hasChanges'], '1') inputs: - artifactName: GitOutput + artifactName: gh-pages targetPath: $(Build.ArtifactStagingDirectory)\gh-pages - script: | echo ##vso[task.logissue type=warning]gh-pages documentation needs updating! Use the published gh-pages artifact from the CI build to update the gh-pages branch. From 0c7d95b37d87f5eab53f198ac5bee3a66ec82ff1 Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Mon, 19 Apr 2021 17:12:33 -0700 Subject: [PATCH 03/14] create dir --- build/templates/template-checkdocs.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index 2c597ed9..db741aee 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -21,6 +21,11 @@ steps: $null = New-Item -Path "$(Build.ArtifactStagingDirectory)/gh-pages" -ItemType Directory } + if ((Test-Path "$(Build.ArtifactStagingDirectory)/GitOutput") -eq $false) + { + $null = New-Item -Path "$(Build.ArtifactStagingDirectory)/GitOutput" -ItemType Directory + } + # backup new website Compress-Archive -Path $(FORepoRoot)/docs/site/* -DestinationPath $(Build.ArtifactStagingDirectory)/gh-pages/gh-pages.zip -Force @@ -28,15 +33,15 @@ steps: get-childitem $(FORepoRoot) -Directory | remove-item -recurse -force # copy new website build to repro root - Expand-Archive -Path $(Build.ArtifactStagingDirectory)\gh-pages\gh-pages.zip -DestinationPath $(FORepoRoot) -Force + Expand-Archive -Path $(Build.ArtifactStagingDirectory)/gh-pages/gh-pages.zip -DestinationPath $(FORepoRoot) -Force # restore sitemap.xml, as it has a timestamp that changes on build git restore sitemap.xml* # add all files and check for changes git add -A - git status > $(Build.ArtifactStagingDirectory)\GitOutput\GitStatus.txt - git diff --cached --exit-code > $(Build.ArtifactStagingDirectory)\GitOutput\GitDiff.txt + git status > $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt + git diff --cached --exit-code > $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt echo ##vso[task.setvariable variable=hasChanges]%errorlevel% displayName: 'Check website for changes' - task: PublishPipelineArtifact@1 @@ -44,13 +49,13 @@ steps: condition: eq(variables['hasChanges'], '1') inputs: artifactName: GitOutput - targetPath: $(Build.ArtifactStagingDirectory)\GitOutput + targetPath: $(Build.ArtifactStagingDirectory)/GitOutput - task: PublishPipelineArtifact@1 displayName: 'Publish gh-pages artifact if website has changes' condition: eq(variables['hasChanges'], '1') inputs: artifactName: gh-pages - targetPath: $(Build.ArtifactStagingDirectory)\gh-pages + targetPath: $(Build.ArtifactStagingDirectory)/gh-pages - script: | echo ##vso[task.logissue type=warning]gh-pages documentation needs updating! Use the published gh-pages artifact from the CI build to update the gh-pages branch. displayName: 'Warn if website has changes' From 7f6c3a15716d795c9e9ab7f7928ac6a56c96d18b Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Mon, 19 Apr 2021 18:28:01 -0700 Subject: [PATCH 04/14] errorcode --- build/internal/UpdateClientSampleForWSK.ps1 | 68 +++------------------ build/templates/template-checkdocs.yml | 2 +- build/templates/template-ci-pr-stages.yml | 8 +-- 3 files changed, 12 insertions(+), 66 deletions(-) diff --git a/build/internal/UpdateClientSampleForWSK.ps1 b/build/internal/UpdateClientSampleForWSK.ps1 index 0eb20341..deabd6c8 100644 --- a/build/internal/UpdateClientSampleForWSK.ps1 +++ b/build/internal/UpdateClientSampleForWSK.ps1 @@ -3,68 +3,14 @@ Param ( - [string]$ProjectFolder + [string]$RepositoryRoot ) -[string]$outputContent = "" -Write-Host "Modifying csproj in $ProjectFolder for WSK use..." -$projs = Get-ChildItem -Path "$ProjectFolder" -Filter "*.csproj" -foreach ($proj in $projs) -{ - $content = Get-Content $proj.FullName - $added = $false - foreach ($line in $content) - { - if (($line -like "**") - { - Write-host "skip $line" - $inskip = $false - continue - } - elseif (($line -like "**") -and $inskip) - { - Write-host "skip $line" - $inskip = $false - continue - } - - if (-not $inskip) - { - if ($line -like "**") - { - # fix output path - $outputContent += ' .\bin\$(Configuration)\$(Platform)\$(TargetName)' + "`n" - } - elseif (-not ($line -like "*ProjectReference*Include*")) - { - $outputContent += $line + "`n" - } - elseif ($added -eq $false) - { - # Add all the needed references, but for the WSK - $outputContent += " `n" - $outputContent += " `..\lib\NetStandard\Microsoft.FactoryOrchestrator.Client.dll`n" - $outputContent += " `n" - $outputContent += " `n" - $outputContent += " `..\lib\NetStandard\Microsoft.FactoryOrchestrator.Core.dll`n" - $outputContent += " `n" - $outputContent += " `n" - $outputContent += " `..\lib\NetStandard\OpenSourceSoftware\IpcServiceFramework\IpcServiceFramework.Client.dll`n" - $outputContent += " `n" - $outputContent += " `n" - $outputContent += " `..\lib\NetStandard\OpenSourceSoftware\IpcServiceFramework\IpcServiceFramework.Core.dll`n" - $outputContent += " `n" - - $added = $true - } - } - } +$ErrorActionPreference = "stop" +Set-Location $RepositoryRoot - Set-Content -Path "$($proj.FullName)" -Value $outputContent +if (!(Test-Path ".\src\FactoryOrchestrator.sln")) +{ + Write-Error "$RepositoryRoot is not the root of the Factory Orchestrator repository!" } + diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index db741aee..567e3637 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -42,7 +42,7 @@ steps: git add -A git status > $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt git diff --cached --exit-code > $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt - echo ##vso[task.setvariable variable=hasChanges]%errorlevel% + write-host "##vso[task.setvariable variable=hasChanges]$LASTEXITCODE" displayName: 'Check website for changes' - task: PublishPipelineArtifact@1 displayName: 'Publish git output artifact if website has changes' diff --git a/build/templates/template-ci-pr-stages.yml b/build/templates/template-ci-pr-stages.yml index 9dac6665..8b9b8d8f 100644 --- a/build/templates/template-ci-pr-stages.yml +++ b/build/templates/template-ci-pr-stages.yml @@ -29,9 +29,6 @@ stages: displayName: 'Set BuildPlatform to x64' - template: ./template-build-app.yml - # Build docs - - template: ./template-checkdocs.yml - - job: "Compliance" pool: vmImage: windows-2019 @@ -63,4 +60,7 @@ stages: displayName: "Print all variables" # Build & Test (Linux) - - template: ./template-build-test-service.yml \ No newline at end of file + - template: ./template-build-test-service.yml + + # Build & Check docs. Do on Linux because this build is faster than Windows (no app build). + - template: ./template-checkdocs.yml From b7fee9ff506eb4c1b31bb102ed50954543686f6d Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Mon, 19 Apr 2021 18:28:36 -0700 Subject: [PATCH 05/14] undo oops --- build/internal/UpdateClientSampleForWSK.ps1 | 68 ++++++++++++++++++--- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/build/internal/UpdateClientSampleForWSK.ps1 b/build/internal/UpdateClientSampleForWSK.ps1 index deabd6c8..0eb20341 100644 --- a/build/internal/UpdateClientSampleForWSK.ps1 +++ b/build/internal/UpdateClientSampleForWSK.ps1 @@ -3,14 +3,68 @@ Param ( - [string]$RepositoryRoot + [string]$ProjectFolder ) -$ErrorActionPreference = "stop" -Set-Location $RepositoryRoot - -if (!(Test-Path ".\src\FactoryOrchestrator.sln")) +[string]$outputContent = "" +Write-Host "Modifying csproj in $ProjectFolder for WSK use..." +$projs = Get-ChildItem -Path "$ProjectFolder" -Filter "*.csproj" +foreach ($proj in $projs) { - Write-Error "$RepositoryRoot is not the root of the Factory Orchestrator repository!" -} + $content = Get-Content $proj.FullName + $added = $false + foreach ($line in $content) + { + if (($line -like "**") + { + Write-host "skip $line" + $inskip = $false + continue + } + elseif (($line -like "**") -and $inskip) + { + Write-host "skip $line" + $inskip = $false + continue + } + if (-not $inskip) + { + if ($line -like "**") + { + # fix output path + $outputContent += ' .\bin\$(Configuration)\$(Platform)\$(TargetName)' + "`n" + } + elseif (-not ($line -like "*ProjectReference*Include*")) + { + $outputContent += $line + "`n" + } + elseif ($added -eq $false) + { + # Add all the needed references, but for the WSK + $outputContent += " `n" + $outputContent += " `..\lib\NetStandard\Microsoft.FactoryOrchestrator.Client.dll`n" + $outputContent += " `n" + $outputContent += " `n" + $outputContent += " `..\lib\NetStandard\Microsoft.FactoryOrchestrator.Core.dll`n" + $outputContent += " `n" + $outputContent += " `n" + $outputContent += " `..\lib\NetStandard\OpenSourceSoftware\IpcServiceFramework\IpcServiceFramework.Client.dll`n" + $outputContent += " `n" + $outputContent += " `n" + $outputContent += " `..\lib\NetStandard\OpenSourceSoftware\IpcServiceFramework\IpcServiceFramework.Core.dll`n" + $outputContent += " `n" + + $added = $true + } + } + } + + Set-Content -Path "$($proj.FullName)" -Value $outputContent +} From 589c4b1eb23f140f642654d2b5dd20af53de8edf Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Mon, 19 Apr 2021 18:47:04 -0700 Subject: [PATCH 06/14] slash --- build/templates/template-checkdocs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index 567e3637..e07cebfd 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -4,11 +4,11 @@ # Runs mkdocs to check if docs need updating on gh-pages. # Core and Client projects must be built for it to detect API changes. steps: -- script: | +- pwsh: | cd $(FORepoRoot) - mkdir $(Build.ArtifactStagingDirectory)\Patch - pip install --upgrade pip --upgrade -r $(FORepoRoot)\docs\requirements.txt - mkdocs build --clean --config-file $(FORepoRoot)\docs\mkdocs.yml + mkdir $(Build.ArtifactStagingDirectory)/Patch + pip install --upgrade pip --upgrade -r $(FORepoRoot)/docs/requirements.txt + mkdocs build --clean --config-file $(FORepoRoot)/docs/mkdocs.yml displayName: 'Build website' - pwsh: | # checkout gh-pages From ab8af5f75910b2058b7e552409854d1dd74cba38 Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Mon, 19 Apr 2021 19:49:32 -0700 Subject: [PATCH 07/14] track --- build/templates/template-checkdocs.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index e07cebfd..b0a294ed 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -15,7 +15,7 @@ steps: git reset HEAD --hard git fetch git checkout gh-pages - + write-host "Checked out gh-pages branch" if ((Test-Path "$(Build.ArtifactStagingDirectory)/gh-pages") -eq $false) { $null = New-Item -Path "$(Build.ArtifactStagingDirectory)/gh-pages" -ItemType Directory @@ -26,18 +26,23 @@ steps: $null = New-Item -Path "$(Build.ArtifactStagingDirectory)/GitOutput" -ItemType Directory } + write-host "Archiving built website..." # backup new website Compress-Archive -Path $(FORepoRoot)/docs/site/* -DestinationPath $(Build.ArtifactStagingDirectory)/gh-pages/gh-pages.zip -Force + write-host "Archiving built website... DONE!" # wipe subfolders, to ensure we also catch page and media deletions + write-host "Deleting all subfolders..." get-childitem $(FORepoRoot) -Directory | remove-item -recurse -force - + # copy new website build to repro root + write-host "Extracting built website..." Expand-Archive -Path $(Build.ArtifactStagingDirectory)/gh-pages/gh-pages.zip -DestinationPath $(FORepoRoot) -Force + write-host "Extracting built website... DONE!" + write-host "Using git commands to check for changes..." # restore sitemap.xml, as it has a timestamp that changes on build git restore sitemap.xml* - # add all files and check for changes git add -A git status > $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt From 7923e33e5d92357220227a3f4b58870c47fda917 Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 13:34:05 -0700 Subject: [PATCH 08/14] Use out-file --- build/templates/template-checkdocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index b0a294ed..b55ba6ba 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -45,8 +45,8 @@ steps: git restore sitemap.xml* # add all files and check for changes git add -A - git status > $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt - git diff --cached --exit-code > $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt + git status | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt + git diff --cached --exit-code | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt write-host "##vso[task.setvariable variable=hasChanges]$LASTEXITCODE" displayName: 'Check website for changes' - task: PublishPipelineArtifact@1 From 8cbcc84bae6813157d2ff869e870060e58847f8b Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 16:17:56 -0700 Subject: [PATCH 09/14] wip --- build/internal/gh-pagesUpdate.ps1 | 45 ++++++++++++++++++++++++++ build/templates/template-checkdocs.yml | 3 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 build/internal/gh-pagesUpdate.ps1 diff --git a/build/internal/gh-pagesUpdate.ps1 b/build/internal/gh-pagesUpdate.ps1 new file mode 100644 index 00000000..062b2f13 --- /dev/null +++ b/build/internal/gh-pagesUpdate.ps1 @@ -0,0 +1,45 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + +# Updates the gh-pages branch with the latest documentation changes +( + [string]$RepoRoot, + [switch]$Force +) + +$zip = Join-Path $PSScriptRoot "gh-pages.zip" + +if (!(Test-Path $zip)) +{ + Write-Error "$zip not found!" +} + +if (!(Test-Path (Join-Path $RepoRoot "src/FactoryOrchestrator.sln"))) +{ + Write-Error "$RepoRoot is not a valid FactoryOrchestrator repo!" +} + +Set-Location $RepoRoot +git fetch public +git reset HEAD --hard +git clean -d -f +git checkout public/gh-pages +get-childitem $RepoRoot -Directory | remove-item -recurse -force + +# copy new website build to repro root +write-host "Extracting built website..." +Expand-Archive -Path $zip -DestinationPath $RepoRoot -Force +write-host "Extracting built website... DONE!" + +write-host "Using git commands to check for changes..." +# restore sitemap.xml, as it has a timestamp that changes on build +git restore sitemap.xml* +# add all files and check for changes +git add -A +git diff --cached --exit-code + +if ($LASTEXITCODE -ne 0) +{ + git commit -m "Update documentation" + #git push public HEAD:gh-pages --force +} diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index b55ba6ba..d287e386 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -5,12 +5,13 @@ # Core and Client projects must be built for it to detect API changes. steps: - pwsh: | - cd $(FORepoRoot) + Set-Location $(FORepoRoot) mkdir $(Build.ArtifactStagingDirectory)/Patch pip install --upgrade pip --upgrade -r $(FORepoRoot)/docs/requirements.txt mkdocs build --clean --config-file $(FORepoRoot)/docs/mkdocs.yml displayName: 'Build website' - pwsh: | + Set-Location $(FORepoRoot) # checkout gh-pages git reset HEAD --hard git fetch From ad42b3fe943125e966d7bc28393d0ce932316d69 Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 16:18:58 -0700 Subject: [PATCH 10/14] wip --- build/templates/template-checkdocs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index d287e386..c784cbe1 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -45,8 +45,11 @@ steps: # restore sitemap.xml, as it has a timestamp that changes on build git restore sitemap.xml* # add all files and check for changes + write-host "1" git add -A + write-host "2" git status | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt + write-host "3" git diff --cached --exit-code | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt write-host "##vso[task.setvariable variable=hasChanges]$LASTEXITCODE" displayName: 'Check website for changes' From e8f75cc93621c8eb2292d88f3a1d25ad6251a19f Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 16:38:48 -0700 Subject: [PATCH 11/14] wip --- build/templates/template-checkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index c784cbe1..5657136e 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -51,6 +51,7 @@ steps: git status | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt write-host "3" git diff --cached --exit-code | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt + write-host "4" write-host "##vso[task.setvariable variable=hasChanges]$LASTEXITCODE" displayName: 'Check website for changes' - task: PublishPipelineArtifact@1 From 8f67daf074d86204b8f8b2778604c9ce8ea1324b Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 16:53:44 -0700 Subject: [PATCH 12/14] fix --- build/templates/template-checkdocs.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index 5657136e..bbc126e4 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -45,13 +45,15 @@ steps: # restore sitemap.xml, as it has a timestamp that changes on build git restore sitemap.xml* # add all files and check for changes - write-host "1" git add -A - write-host "2" git status | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt - write-host "3" - git diff --cached --exit-code | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt - write-host "4" + git diff --cached --exit-code + $hasChanges = $LASTEXITCODE + + if ($hasChanges -ne 0) + { + git diff --cached --exit-code | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt + } write-host "##vso[task.setvariable variable=hasChanges]$LASTEXITCODE" displayName: 'Check website for changes' - task: PublishPipelineArtifact@1 From b685dade749131ad094bbcf1407f990684d0bbbe Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 16:54:26 -0700 Subject: [PATCH 13/14] EDIT DOC REVERT ME --- docs/docs/get-started-with-factory-orchestrator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/get-started-with-factory-orchestrator.md b/docs/docs/get-started-with-factory-orchestrator.md index 30f246dd..13b18be1 100644 --- a/docs/docs/get-started-with-factory-orchestrator.md +++ b/docs/docs/get-started-with-factory-orchestrator.md @@ -24,7 +24,7 @@ To start the service manually, run the following from an administrator PowerShel ```PowerShell Start-Service -Name "Microsoft.FactoryOrchestrator" ``` - +TESTEST ### Install the service on Linux [Download](https://github.com/microsoft/FactoryOrchestrator/releases) and unzip the service for your target OS and architecture. Then run the included InstallFactoryOrchestratorService.sh file with bash as sudo. If you want the service to start automatically every boot, add an "enable" argument. Without this the service must be started manually every boot. From 16a0a73f5a3ff9f615c0f0dfd89e79e72c1fa54d Mon Sep 17 00:00:00 2001 From: Jake Friedman Date: Tue, 20 Apr 2021 17:17:06 -0700 Subject: [PATCH 14/14] wip --- build/templates/template-checkdocs.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/templates/template-checkdocs.yml b/build/templates/template-checkdocs.yml index bbc126e4..3de91aeb 100644 --- a/build/templates/template-checkdocs.yml +++ b/build/templates/template-checkdocs.yml @@ -48,12 +48,6 @@ steps: git add -A git status | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitStatus.txt git diff --cached --exit-code - $hasChanges = $LASTEXITCODE - - if ($hasChanges -ne 0) - { - git diff --cached --exit-code | out-file $(Build.ArtifactStagingDirectory)/GitOutput/GitDiff.txt - } write-host "##vso[task.setvariable variable=hasChanges]$LASTEXITCODE" displayName: 'Check website for changes' - task: PublishPipelineArtifact@1