-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipeline.yml
75 lines (61 loc) · 1.79 KB
/
azure-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
trigger:
batch: true
branches:
include:
- master
variables:
- group: product-readiness.docfx
- name: gitRepo
value: PI-Adapter-BACnet-Docs
jobs:
- job: Publish
pool:
vmImage: 'vs2017-win2016'
steps:
- script: |
choco install DocFX
displayName: 'Install DocFX'
- script: |
echo "Clone source"
mkdir source
cd source
git clone https://user:$(gitToken)@github.com/osisoft/$(gitRepo).git --recurse-submodules
dir
echo "Submodule setup"
cd $(gitRepo)
dir
git submodule init
git submodule update
echo "Submodule checkout/pull - V1\main"
cd V1\main
git checkout master
git pull
git rev-parse HEAD
dir
cd ..\..
echo "Run DocFX"
docfx.exe ./docfx.json --template ./_exported_templates/default
echo "Set up Git"
git config user.name az-pipeline
git config user.email [email protected]
echo "Move output files"
mv .\_site $(Build.ArtifactStagingDirectory)\_site
git clean -fd
rmdir V1\main /s /q
echo "Check out gh-pages branch"
git checkout gh-pages
git rm *
echo "Copy DocFX output into branch"
Xcopy /E /I $(Build.ArtifactStagingDirectory)\_site\* .
rmdir obj /s /q
echo "Stage changes"
git add .
git checkout gh-pages
git branch
echo "Commit changes"
git commit -m "Build Agent Modified DocFX Site"
echo "Push changes"
git push --verbose
echo "Complete!"
workingDirectory: 'C:\'
displayName: 'Publish DocFX'