forked from Accenture/Ocaramba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PublishingApiDocumentationOn_gh-pages.ps1
58 lines (32 loc) · 2.09 KB
/
PublishingApiDocumentationOn_gh-pages.ps1
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
echo '********************************************Copying files for gh-pages********************************************'
Copy-Item -Path .\README.md -Destination .\Ocaramba.Documentation\Help\ -recurse -force -verbose
New-Item .\Ocaramba.Documentation\Help\Ocaramba.Documentation\icons\ -Type Directory
Copy-Item -Path .\Ocaramba.Documentation\icons\Objectivity_logo_avatar.png -Destination .\Ocaramba.Documentation\Help\Ocaramba.Documentation\icons\ -recurse -force -verbose
Copy-Item -Path .\Ocaramba.Documentation\icons\Help.png -Destination .\Ocaramba.Documentation\Help\Ocaramba.Documentation\icons\ -recurse -force -verbose
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
echo '********************************************Cloning gh-pages branch********************************************'
Invoke-Expression "git config --global credential.helper store"
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GithubAuthToken):[email protected]`n"
Invoke-Expression "git config --global core.autocrlf true"
Invoke-Expression "git config --global user.email '[email protected]'"
Invoke-Expression "git config --global user.name 'TestAutomationGroup'"
Invoke-Expression "git clone https://github.com/ObjectivityLtd/Test.Automation.git --branch gh-pages .\Help"
Remove-Item -recurse .\Help\* -exclude .git
} else
{
New-Item -ItemType Directory -Force -Path .\Help
}
Copy-Item -Path .\Ocaramba.Documentation\Help\** -Destination .\Help\ -recurse -force
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
echo '********************************************Publishing new version of gh-pages********************************************'
cd .\\Help
Invoke-Expression "git add --all"
Invoke-Expression "git commit -m 'Publishing to gh-pages $env:appveyor_build_version'"
Invoke-Expression "git push origin gh-pages --porcelain"
cd ..
Remove-Item .\\Help\\.git -Force -Recurse -ErrorAction SilentlyContinue
}
7z a gh-pages_$env:appveyor_build_version.zip .\\Help\\**
appveyor PushArtifact gh-pages_$env:appveyor_build_version.zip