diff --git a/.gitignore b/.gitignore index aa2df3d..a6cb905 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ *.out *.toc *.lof +travis-deploy-key-id_rsa +travis-deploy-key-id_rsa.pub diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4159286 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,54 @@ +language: c +sudo: false + +before_install: + - true + +addons: + apt: + packages: + - texlive-latex-base + - texlive-fonts-extra + - texlive-fonts-recommended + - texlive-latex-extra + # on 12.04: texlive-latex3, but use texlive-latex-recommended on more recent versions of Ubuntu. + - texlive-latex3 + - texlive-latex-recommended + - pgf + - latex-xcolor + - lmodern + - texlive-math-extra + +install: + - echo "LaTeX extra packages:" + - latex_home=$(kpsewhich -var-value=TEXMFHOME) + - curl -L -o newunicodechar.ins http://mirrors.ctan.org/macros/latex/contrib/newunicodechar/newunicodechar.ins + - curl -L -o newunicodechar.dtx http://mirrors.ctan.org/macros/latex/contrib/newunicodechar/newunicodechar.dtx + - latex newunicodechar.ins + - mkdir -p "$latex_home/tex/latex/newunicodechar" + - mv newunicodechar.sty "$latex_home/tex/latex/newunicodechar" + - curl -L -o mathpartir.dtx http://mirrors.ctan.org/macros/latex/contrib/mathpartir/mathpartir.dtx + - curl -L -o mathpartir.ins http://mirrors.ctan.org/macros/latex/contrib/mathpartir/mathpartir.ins + - latex mathpartir.ins + - mkdir -p "$latex_home/tex/latex/mathpartir" + - mv mathpartir.sty "$latex_home/tex/latex/mathpartir" + - curl -L -o pgf.zip https://downloads.sourceforge.net/project/pgf/pgf/version%203.0.1/pgf_3.0.1.tds.zip + - unzip -d "$latex_home" pgf.zip + - curl -L -o pgfplots.zip https://downloads.sourceforge.net/project/pgfplots/pgfplots/1.15/pgfplots_1.15.tds.zip + - unzip -d "$latex_home" pgfplots.zip + - echo "Finished installing extra latex packages." + # ################## # + # Actual LaTeX build # + # ################## # + - pdflatex -halt-on-error -interaction=nonstopmode main.tex + - bibtex main + - pdflatex -halt-on-error -interaction=nonstopmode main.tex + - pdflatex -halt-on-error -interaction=nonstopmode main.tex + - pdflatex -halt-on-error -interaction=nonstopmode main.tex + # ################## # + # End of LaTeX build # + # ################## # + - bash ./auto-push-gh-pages.sh + +script: + - true \ No newline at end of file diff --git a/README.md b/README.md index a01596c..ede3fab 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +[](https://travis-ci.org/jsmaniac/journal-article) +[](http://jsmaniac.github.io/travis-stats/#jsmaniac/journal-article) +[](http://ajl-demo.fr/2016/) +[](https://jsmaniac.github.io/journal-article-gh-pages/main.pdf) + # journal-article This repository contains the LaTeX code for our upcoming journal article. diff --git a/auto-push-gh-pages.sh b/auto-push-gh-pages.sh new file mode 100755 index 0000000..d444183 --- /dev/null +++ b/auto-push-gh-pages.sh @@ -0,0 +1,50 @@ +#!/bin/sh +set -e +set +x +if test "$(git config remote.origin.url)" != "https://github.com/jsmaniac/journal-article.git"; then + echo "Not on official repo, will not deploy gh-pages." +elif test "$TRAVIS_PULL_REQUEST" != "false"; then + echo "This is a Pull Request, will not deploy gh-pages." +elif test "$TRAVIS_BRANCH" != "master"; then + echo "Not on master branch (TRAVIS_BRANCH = $TRAVIS_BRANCH), will not deploy gh-pages." +# A key can be created following the steps at https://docs.travis-ci.com/user/encrypting-files/ . +# ssh-keygen -f travis-deploy-key-id_rsa -C 'Deploy key for travis-ci' +# travis encrypt-file travis-deploy-key-id_rsa +elif test -z "${encrypted_264397dfc790_key:-}" -o -z "${encrypted_264397dfc790_iv:-}"; then + echo "Travis CI secure environment variables are unavailable, will not deploy gh-pages." +else + set -x + echo "Automatic push to gh-pages" + + # Git configuration: + git config --global user.name "$(git log --format="%aN" HEAD -1) (Travis CI automatic commit)" + git config --global user.email "$(git log --format="%aE" HEAD -1)" + + # SSH configuration + mkdir -p ~/.ssh + chmod 700 ~/.ssh + set +x + if openssl aes-256-cbc -K $encrypted_264397dfc790_key -iv $encrypted_264397dfc790_iv -in travis-deploy-key-id_rsa.enc -out travis-deploy-key-id_rsa -d >/dev/null 2>&1; then + echo "Decrypted key successfully." + else + echo "Error while decrypting key." + fi + mv travis-deploy-key-id_rsa ~/.ssh/travis-deploy-key-id_rsa + set -x + chmod 600 ~/.ssh/travis-deploy-key-id_rsa + set +x + eval `ssh-agent -s` + set -x + ssh-add ~/.ssh/travis-deploy-key-id_rsa + + TRAVIS_GH_PAGES_DIR="$HOME/travis-gh-pages-$(date +%s)" + if test -e $TRAVIS_GH_PAGES_DIR; then rm -rf $TRAVIS_GH_PAGES_DIR; fi + mkdir -p "$TRAVIS_GH_PAGES_DIR" + mv -i main.pdf $TRAVIS_GH_PAGES_DIR/main.pdf + git init $TRAVIS_GH_PAGES_DIR + touch $TRAVIS_GH_PAGES_DIR/.nojekyll + (cd $TRAVIS_GH_PAGES_DIR && git add -A . && git commit -m "Auto-publish to gh-pages") > commit.log || (cat commit.log && exit 1) + (cd $TRAVIS_GH_PAGES_DIR && git log --oneline --decorate --graph -10) + echo '(cd '"$TRAVIS_GH_PAGES_DIR"'; git push --force --quiet "git@github.com/jsmaniac/journal-article-gh-pages.git" master:gh-pages)' + (cd $TRAVIS_GH_PAGES_DIR; git push --force --quiet "git@github.com:jsmaniac/journal-article-gh-pages.git" master:gh-pages >/dev/null 2>&1) >/dev/null 2>&1 # redirect to /dev/null to avoid showing credentials. +fi \ No newline at end of file diff --git a/biblio.bib b/biblio.bib old mode 100755 new mode 100644 diff --git a/travis-deploy-key-id_rsa.enc b/travis-deploy-key-id_rsa.enc new file mode 100644 index 0000000..2e8b1d0 Binary files /dev/null and b/travis-deploy-key-id_rsa.enc differ