Change dox generation to a travis job

This commit is contained in:
Jordan Brown
2020-05-13 13:01:23 -04:00
parent da9e15607d
commit 3215aefbbf
4 changed files with 64 additions and 51 deletions
+18 -5
View File
@@ -12,6 +12,15 @@ branches:
jobs:
include:
- env:
- DoxGeneration=true
name: "Dox Generation"
addons:
apt:
packages:
- doxygen
- graphviz
- env:
- DoxGeneration=false
- DockerBuild=false
- DMAPI=true
- BYOND_MAJOR="513"
@@ -28,6 +37,7 @@ jobs:
- libc6-i386
- libstdc++6:i386
- env:
- DoxGeneration=false
- DockerBuild=false
- DMAPI=false
- CONFIG=Debug
@@ -46,6 +56,7 @@ jobs:
- libc6-i386
- libstdc++6:i386
- env:
- DoxGeneration=false
- DockerBuild=false
- DMAPI=false
- CONFIG=Release
@@ -64,16 +75,18 @@ jobs:
- libc6-i386
- libstdc++6:i386
- env:
- DoxGeneration=false
- DockerBuild=true
name: "Docker Build"
services:
- docker
install:
- if [ $DockerBuild = false ] && [ $DMAPI = true ]; then build/install_byond.sh; fi
- if [ $DockerBuild = false ] && [ $DMAPI = false ]; then dotnet restore tgstation-server.sln; fi
- if [ $DoxGeneration = false ] && [ $DockerBuild = false ] && [ $DMAPI = true ]; then build/install_byond.sh; fi
- if [ $DoxGeneration = false ] && [ $DockerBuild = false ] && [ $DMAPI = false ]; then dotnet restore tgstation-server.sln; fi
script:
- if [ $DockerBuild = false ] && [ $DMAPI = true ]; then tests/DMAPI/BasicOperation/build_byond.sh || travis_terminate 1; fi
- if [ $DockerBuild = false ] && [ $DMAPI = false ]; then build/test_core.sh; fi
- if [ $DockerBuild = true ]; then docker build . -f build/Dockerfile; fi
- if [ $DoxGeneration = false ] && [ $DockerBuild = false ] && [ $DMAPI = true ]; then tests/DMAPI/BasicOperation/build_byond.sh || travis_terminate 1; fi
- if [ $DoxGeneration = false ] && [ $DockerBuild = false ] && [ $DMAPI = false ]; then build/test_core.sh; fi
- if [ $DoxGeneration = false ] && [ $DockerBuild = true ]; then docker build . -f build/Dockerfile; fi
- if [ $DoxGeneration = true ]; then build/build_dox.sh; fi
+1 -4
View File
@@ -36,9 +36,7 @@ artifacts:
name: ServerUpdatePackage
- path: src/DMAPI
name: DMAPI
- path: tgsdox
name: DocumentationHtml
- path: swagger.json
- path: C:/swagger.json
name: SwaggerSpec
cache:
- ~\.nuget\packages -> **\*.csproj
@@ -82,7 +80,6 @@ test_script:
- lint-openapi -p -c build/OpenApiValidationSettings.json C:/swagger.json
after_test:
- ps: build/UploadCoverage.ps1
- ps: build/BuildDox.ps1
#host updater
- dotnet publish src/Tgstation.Server.Host/Tgstation.Server.Host.csproj -o artifacts/ServerHost -c %CONFIGURATION%
#console
-42
View File
@@ -1,42 +0,0 @@
$bf = $Env:APPVEYOR_BUILD_FOLDER
$doxdir = "C:\tgsdox"
New-Item -Path $doxdir -ItemType directory
$publish_dox = (-not (Test-Path Env:APPVEYOR_PULL_REQUEST_NUMBER)) -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master")
if($publish_dox){
$github_url = "github.com/$Env:APPVEYOR_REPO_NAME"
echo "Cloning https://git@$github_url..."
git clone -b gh-pages --single-branch "https://git@$github_url" "$doxdir" 2>$null
rm -r "$doxdir\*"
}
Add-Content "$bf\docs\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/build/tgs.ico`nHAVE_DOT=YES"
&"C:\Program Files\doxygen\bin\doxygen.exe" "$bf\docs\Doxyfile"
if($publish_dox){
cd $doxdir
git config --global push.default simple
git config user.name "tgstation-server"
git config user.email "tgstation-server@tgstation13.org"
echo '# THIS BRANCH IS AUTO GENERATED BY APPVEYOR CI' > README.md
# Add in the swagger specification
cp C:/swagger.json "$doxdir/swagger.json"
# Need to create a .nojekyll file to allow filenames starting with an underscore
# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file.
echo "" > .nojekyll
git add --all
git commit -m "Deploy code docs to GitHub Pages for Appveyor build $Env:APPVEYOR_BUILD_NUMBER" -m "Commit: $Env:APPVEYOR_REPO_COMMIT"
git push -f "https://$Env:TGS4_TEST_GITHUB_TOKEN@$github_url" 2>&1 | out-null
cd "$bf"
rm -r "$doxdir/.git"
}
mv C:/tgsdox "$bf/tgsdox"
# Add in the swagger specification
cp C:/swagger.json "$bf/swagger.json"
+45
View File
@@ -0,0 +1,45 @@
#!/bin/bash
BUILD_FOLDER=$TRAVIS_BUILD_DIR
DOXDIR=~/tgsdox
mkdir -p $DOXDIR
if [ "$TRAVIS_PULL_REQUEST" -eq "$false" ] && [ "$TRAVIS_BRANCH" -eq "master" ]; then
PUBLISH_DOX=true
else
PUBLISH_DOX=false
fi
if [ "$PUBLISH_DOX" = true ] ; then
GITHUB_URL="github.com/$TRAVIS_PULL_REQUEST_SLUG"
echo "Cloning https://git@$GITHUB_URL..."
git clone -b gh-pages --single-branch "https://git@$GITHUB_URL" "$DOXDIR" 2> /dev/null
rm -r "$DOXDIR\*"
fi
VERSION=cat "$BUILD_FOLDER/build/Version.props" | grep -oPm1 "(?<=<TgsCoreVersion>)[^<]+"
echo -e "\nPROJECT_NUMBER = $VERSION\nINPUT = $BUILD_FOLDER\nOUTPUT_DIRECTORY = $DOXDIR\nPROJECT_LOGO = $BUILD_FOLDER/build/tgs.ico\nHAVE_DOT=YES" >> "$BUILD_FOLDER/docs/Doxyfile"
doxygen "$BUILD_FOLDER/docs/Doxyfile"
if [ "$PUBLISH_DOX" = true ] ; then
cd $DOXDIR
git config --global push.default simple
git config user.name "tgstation-server"
git config user.email "tgstation-server@tgstation13.org"
echo '# THIS BRANCH IS AUTO GENERATED BY APPVEYOR CI' > README.md
# Need to create a .nojekyll file to allow filenames starting with an underscore
# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file.
echo "" > .nojekyll
git add --all
git commit -m "Deploy code docs to GitHub Pages for Travis build $TRAVIS_BUILD_NUMBER" -m "Commit: $TRAVIS_COMMIT"
git push -f "https://$TGS4_TEST_GITHUB_TOKEN@$GITHUB_URL" 2>&1 | out-null
cd "$BUILD_FOLDER"
rm -r "$DOXDIR/.git"
fi
mv $DOXDIR "$BUILD_FOLDER/tgsdox"