diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c478bab --- /dev/null +++ b/.travis.yml @@ -0,0 +1,76 @@ +branches: + only: + - master +env: + global: + - BUILD_WEB=/tmp/build-web + - secure: dMquVRuM4Wi/N3oZJaNIWSW5mpehxVuzDiDnC51OwfMtdNfdyWV7qKJQY44MjbveuyQd7eA/AuTLE+loaAFxiRfBXl2yI5NkAOrJwbbDyw/lAN9Og2FmNi+QLaTsNhpbYZ4zaUNEEqRWs9gIajGaXcWdO/HNYiKHHrk7+XXNDeM= +addons: + apt: + packages: + - ikiwiki + - asciidoc + - imagemagick + - luarocks + - cmake + - libxcb-randr0-dev + - libxcb-xtest0-dev + - libxcb-xinerama0-dev + - libxcb-shape0-dev + - libxcb-util0-dev + - libxcb-keysyms1-dev + - libxcb-icccm4-dev + - libxdg-basedir-dev + - libstartup-notification0-dev + # Dependencies for xcb-util-cursor + - 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 + - (cd /tmp && tar -xvjf util-cursor.tar.bz2 && cd xcb-util-cursor* && ./configure --prefix=$HOME/install && make && make install) + + # ldoc is not available in Ubuntu Ancient + - travis_retry luarocks --local install ldoc + - luarocks path --bin + - eval `luarocks path --bin` + # Of course Ubuntu's Luarocks version is too old for --bin + - PATH="$PATH:$HOME/.luarocks/bin" + +script: + - PKG_CONFIG_PATH="$HOME/install/lib/pkgconfig" make build_for_travis + +after_success: + - | + 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 diff --git a/Makefile b/Makefile index 697fe66..390c6ea 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -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 \ - --exclude=html --exclude=Makefile --rss --url http://awesome.naquadah.org + --exclude=html --exclude=Makefile --rss --url https://awesomewm.org/ authors.mdwn: echo '## Primary' > authors.mdwn @@ -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