forked from 51Degrees/common-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnightly-documentation-update.ps1
63 lines (49 loc) · 1.48 KB
/
nightly-documentation-update.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
59
60
61
62
63
param (
[Parameter(Mandatory=$true)]
[string]$RepoName,
[Parameter(Mandatory=$true)]
[string]$OrgName,
[string]$GitHubUser = "",
[string]$GitHubEmail = "",
[string]$GitHubToken,
[bool]$DryRun = $False,
[bool]$SeparateExamples= $False
)
./generate-documentation.ps1 `
-RepoName $RepoName `
-OrgName $OrgName `
-GitHubUser $GitHubUser `
-GitHubEmail $GitHubEmail `
-GitHubToken $GitHubToken `
-SeparateExamples $SeparateExamples
if ($SeparateExamples){
$ExamplesRepo = "$RepoName-examples"
$ExamplesPath = [IO.Path]::Combine($RepoName, $ExamplesRepo)
Write-Output "::group::Removing $ExamplesRepo"
Remove-Item -Path $ExamplesPath -Recurse -Force
Write-Output "::endgroup::"
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
Write-Output "::group::Has Changed"
./steps/has-changed.ps1 -RepoName $RepoName
Write-Output "::endgroup::"
if ($LASTEXITCODE -eq 0) {
Write-Output "::group::Commit Changes"
./steps/commit-changes.ps1 -RepoName $RepoName -Message "REF: Updated documentation."
Write-Output "::endgroup::"
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Output "::group::Push Changes"
./steps/push-changes.ps1 -RepoName $RepoName -Branch gh-pages -DryRun $DryRun
Write-Output "::endgroup::"
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
else {
Write-Host "No property changes, so not pushing changes."
}
exit 0