Skip to content

Commit 7b326a5

Browse files
author
Bart Koelman
committed
more logging
more another try more poll for started process update docs during pr build fix fixed merge functions revert verbose
1 parent c2da546 commit 7b326a5

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

Diff for: appveyor.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,37 @@ before_build:
1313
if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE) {
1414
# https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
1515
git checkout $env:APPVEYOR_REPO_BRANCH -q
16-
choco install docfx -y
1716
}
17+
choco install docfx -y
1818
1919
after_build:
2020
- pwsh: |
21-
#if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE) {
22-
CD ./docs
23-
& ./generate-examples.ps1
24-
& docfx docfx.json
25-
if ($lastexitcode -ne 0) {
26-
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
27-
}
28-
29-
git config --global credential.helper store
30-
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:ACCESS_TOKEN):x-oauth-basic@github.com`n"
31-
git config --global user.email "[email protected]"
32-
git config --global user.name "Jared Nance"
33-
git config --global core.autocrlf false
34-
git config --global core.safecrlf false
35-
git clone https://github.com/json-api-dotnet/JsonApiDotNetCore.git -b gh-pages origin_site -q
36-
Copy-Item origin_site/.git _site -recurse
37-
Copy-Item CNAME _site/CNAME
38-
Copy-Item home/*.html _site/
39-
Copy-Item home/*.ico _site/
40-
Copy-Item -Recurse home/assets/* _site/styles/
41-
CD _site
42-
git add -A 2>&1
43-
#git commit -m "CI Updates" -q
21+
CD ./docs
22+
& ./generate-examples.ps1
23+
& docfx docfx.json
24+
if ($lastexitcode -ne 0) {
25+
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
26+
}
27+
28+
git config --global credential.helper store
29+
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:ACCESS_TOKEN):[email protected]`n"
30+
git config --global user.email "jaredcnance@gmail.com"
31+
git config --global user.name "Jared Nance"
32+
git config --global core.autocrlf false
33+
git config --global core.safecrlf false
34+
git clone https://github.com/json-api-dotnet/JsonApiDotNetCore.git -b gh-pages origin_site -q
35+
Copy-Item origin_site/.git _site -recurse
36+
Copy-Item CNAME _site/CNAME
37+
Copy-Item home/*.html _site/
38+
Copy-Item home/*.ico _site/
39+
Copy-Item -Recurse home/assets/* _site/styles/
40+
CD _site
41+
git add -A 2>&1
42+
git commit -m "CI Updates" -q
43+
if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE) {
4444
#git push origin gh-pages -q
4545
echo "Documentation updated successfully."
46-
#}
46+
}
4747
4848
pull_requests:
4949
do_not_increment_build_number: true

Diff for: docs/generate-examples.ps1

+16-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# This script generates response documents for ./request-examples
44

5-
function Kill-WebServer {
5+
function Get-WebServer-ProcessId {
66
$processId = $null
77
if ($IsMacOs || $IsLinux) {
88
$processId = $(lsof -ti:14141)
@@ -14,25 +14,34 @@ function Kill-WebServer {
1414
throw [System.Exception] "Unsupported operating system."
1515
}
1616

17+
return $processId
18+
}
19+
20+
function Kill-WebServer {
21+
$processId = Get-WebServer-ProcessId
22+
1723
if ($processId -ne $null) {
1824
Write-Output "Stopping web server"
1925
Get-Process -Id $processId | Stop-Process
2026
}
21-
2227
}
2328

24-
function Start-Webserver {
29+
function Start-WebServer {
2530
Write-Output "Starting web server"
26-
Start-Job -ScriptBlock { dotnet run --project ..\src\Examples\GettingStarted\GettingStarted.csproj }
31+
Start-Job -ScriptBlock { dotnet run --project ..\src\Examples\GettingStarted\GettingStarted.csproj } | Out-Null
32+
33+
$webProcessId = $null
34+
Do {
35+
Start-Sleep -Seconds 1
36+
$webProcessId = Get-WebServer-ProcessId
37+
} While ($webProcessId -eq $null)
2738
}
2839

2940
Kill-WebServer
30-
Start-Webserver
41+
Start-WebServer
3142

3243
Remove-Item -Force -Path .\request-examples\*.json
3344

34-
Start-Sleep -Seconds 10
35-
3645
$scriptFiles = Get-ChildItem .\request-examples\*.ps1
3746
foreach ($scriptFile in $scriptFiles) {
3847
$jsonFileName = [System.IO.Path]::GetFileNameWithoutExtension($scriptFile.Name) + "_Response.json"

Diff for: docs/request-examples/001_GET_Books.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
curl -s -f -v http://localhost:14141/api/books
1+
curl -s -f http://localhost:14141/api/books

0 commit comments

Comments
 (0)