diff --git a/.travis.yml b/.travis.yml index a1ea801767..6b2e17a91b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_deploy: sudo dpkg -i nsis_3.04-1_amd64.deb; echo ${TRAVIS_REPO_SLUG}; if [[ "${TRAVIS_REPO_SLUG}" == "OpenRA/OpenRA" ]]; then - cd packaging && ./update-wiki.sh ${TRAVIS_TAG} && cd ..; + cd packaging && ./update-wiki.sh ${TRAVIS_TAG} && ./update-docs.sh ${TRAVIS_TAG} && cd ..; fi; fi - export PATH=${PATH}:${HOME}/usr/bin diff --git a/packaging/update-docs.sh b/packaging/update-docs.sh new file mode 100644 index 0000000000..1eee117e47 --- /dev/null +++ b/packaging/update-docs.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +case "$1" in + bleed) + exit + ;; + next | playtest-*) + TAG="playtest" + ;; + master | release-*) + TAG="release" + ;; + *) + echo "Unknown branch: $1" + exit + ;; +esac + +echo "Updating docs.openra.net" + +SSH_KEY="$HOME"/.ssh/id_rsa + +mkdir -p "$(dirname "$SSH_KEY")" +openssl aes-256-cbc -k "$KEY" -in ssh.enc -d -out "$SSH_KEY" +chmod 0600 "$SSH_KEY" + +rm -rf "$HOME/openra-docs" +git clone git@github.com:OpenRA/docs.git "$HOME/openra-docs" + +mono --debug ../OpenRA.Utility.exe all --docs "$1" > "${HOME}/openra-docs/api/${TAG}/traits.md" +mono --debug ../OpenRA.Utility.exe all --weapon-docs "$1" > "${HOME}/openra-docs/api/${TAG}/weapons.md" +mono --debug ../OpenRA.Utility.exe all --lua-docs "$1" > "${HOME}/openra-docs/api/${TAG}/lua.md" + +pushd "$HOME/openra-docs/api/${TAG}" || exit 1 +git config --local user.email "orabot@users.noreply.github.com" +git config --local user.name "orabot" +git add "traits.md" +git add "weapons.md" +git add "lua.md" +git commit -m "Update for branch $1" && +git push origin master +popd || exit + +shred -u "$SSH_KEY" diff --git a/packaging/update-wiki.sh b/packaging/update-wiki.sh index 894b2f76e0..2a7ac6df73 100755 --- a/packaging/update-wiki.sh +++ b/packaging/update-wiki.sh @@ -16,7 +16,7 @@ case "$1" in ;; esac -echo "Updating https://github.com/OpenRA/OpenRA/wiki/" +echo "Updating wiki.openra.net" SSH_KEY="$HOME"/.ssh/id_rsa @@ -27,19 +27,13 @@ chmod 0600 "$SSH_KEY" rm -rf "$HOME/openra-wiki" git clone git@github.com:OpenRA/OpenRA.wiki.git "$HOME/openra-wiki" -mono --debug ../OpenRA.Utility.exe all --docs "$1" > "${HOME}/openra-wiki/Traits${TAG}.md" -mono --debug ../OpenRA.Utility.exe all --weapon-docs "$1" > "${HOME}/openra-wiki/Weapons${TAG}.md" -mono --debug ../OpenRA.Utility.exe all --lua-docs "$1" > "${HOME}/openra-wiki/Lua API${TAG}.md" mono --debug ../OpenRA.Utility.exe all --settings-docs "$1" > "${HOME}/openra-wiki/Settings${TAG}.md" pushd "$HOME/openra-wiki" || exit 1 git config --local user.email "orabot@users.noreply.github.com" git config --local user.name "orabot" -git add "Traits${TAG}.md" -git add "Lua API${TAG}.md" -git add "Weapons${TAG}.md" git add "Settings${TAG}.md" -git commit -m "Update trait and scripting documentation for branch $1" && +git commit -m "Update user documentation for branch $1" && git push origin master popd || exit