Travis: push to awesomeWM.github.io for builds on master

This commit is contained in:
Daniel Hahler 2016-05-16 13:21:22 +02:00
parent 601f442c71
commit 6da11338c4
2 changed files with 80 additions and 34 deletions

View File

@ -1,3 +1,10 @@
branches:
only:
- master
env:
global:
- BUILD_WEB=/tmp/build-web
- secure: dMquVRuM4Wi/N3oZJaNIWSW5mpehxVuzDiDnC51OwfMtdNfdyWV7qKJQY44MjbveuyQd7eA/AuTLE+loaAFxiRfBXl2yI5NkAOrJwbbDyw/lAN9Og2FmNi+QLaTsNhpbYZ4zaUNEEqRWs9gIajGaXcWdO/HNYiKHHrk7+XXNDeM=
addons:
apt:
packages:
@ -19,6 +26,28 @@ addons:
- libxcb-render-util0-dev
- libxcb-image0-dev
# Clone the awesomeWM.github.io repo before building, so that in case of
# concurrent builds, the push will fail later.
# Stderr is redirected to not reveal the token.
before_install:
- |
set -e
git clone --quiet \
https://${GH_APIDOC_TOKEN}@github.com/awesomeWM/awesomeWM.github.io \
"$BUILD_WEB" 2>/dev/null
if [ "$TRAVIS_PULL_REQUEST" = false ]; then
branch="$TRAVIS_BRANCH"
else
branch="pr-$TRAVIS_PULL_REQUEST"
fi
if [ "$branch" != master ]; then
cd $BUILD_WEB
if ! git checkout -b "$branch" "origin/$branch"; then
git checkout -b "$branch"
fi
cd -
fi
install:
# libxcb-cursor-dev is not available in Ubuntu Ancient
- travis_retry wget --no-check-certificate https://xcb.freedesktop.org/dist/xcb-util-cursor-0.1.3.tar.bz2 -O /tmp/util-cursor.tar.bz2
@ -32,7 +61,16 @@ install:
- PATH="$PATH:$HOME/.luarocks/bin"
script:
- PKG_CONFIG_PATH="$HOME/install/lib/pkgconfig" make push
- PKG_CONFIG_PATH="$HOME/install/lib/pkgconfig" make build_for_travis
after_success:
- echo TODO: update the gh-pages here (if on the right branch, not a PR etc)
- |
set -e
commit_hash=$(git rev-parse --short HEAD)
cd $BUILD_WEB
git config user.name "awesome-robot on Travis CI"
git config user.email "awesome-robot@users.noreply.github.com"
git add --all .
git commit -m "Update from Travis for awesome-www@${commit_hash}"
git show --stat
git push origin "$(git symbolic-ref --quiet HEAD)" 2>/dev/null

View File

@ -1,7 +1,7 @@
push: output ldoc changelogs manpages
rsync -PaOvz --chmod=u=rwX,g=rwX,o=rX,Dg+s --exclude src html/ awesome.naquadah.org:/var/www/awesome.naquadah.org/
rsync -PaOvz --chmod=u=rwX,g=rwX,o=rX,Dg+s --delete src/build/doc/ awesome.naquadah.org:/var/www/awesome.naquadah.org/doc/api
rsync -PaOvz --chmod=u=rwX,g=rwX,o=rX,Dg+s /usr/share/asciidoc/icons awesome.naquadah.org:/var/www/awesome.naquadah.org/doc/manpages/icons
# Make git not use user's config.
HOME:=/dev/null
all: output ldoc changelogs manpages
output: authors.mdwn
ikiwiki $(CURDIR) html -v --wikiname about --plugin=goodstuff --templatedir=templates \
@ -38,4 +38,12 @@ manpages:
do asciidoc -a icons -b xhtml11 -o ../../html/doc/manpages/`basename $${manpage} .txt`.html $$manpage || exit 1; \
done
build_for_travis: all
rsync -PaOvz --chmod=u=rwX,g=rwX,o=rX,Dg+s --exclude src html/ \
$${BUILD_WEB}
rsync -PaOvz --chmod=u=rwX,g=rwX,o=rX,Dg+s --delete src/build/doc/ \
$${BUILD_WEB}/doc/api
rsync -PaOvz --chmod=u=rwX,g=rwX,o=rX,Dg+s /usr/share/asciidoc/icons \
$${BUILD_WEB}/doc/manpages/icons
.PHONY: authors.mdwn changelogs manpages