Automatic builds of the LaTeX file on travis-ci, and automatic deployment from my fork. Added dependency on lmodern and stmaryrd packages. Upgraded pgf and pgfplots. Used -halt-on-error -interaction=nonstopmode .

This commit is contained in:
Georges Dupéron 2017-08-17 14:34:04 +02:00
parent fe9356f7f0
commit eb3237c8be
6 changed files with 111 additions and 0 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@
*.out
*.toc
*.lof
travis-deploy-key-id_rsa
travis-deploy-key-id_rsa.pub

54
.travis.yml Normal file
View File

@ -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

View File

@ -1,3 +1,8 @@
[![Build Status,](https://img.shields.io/travis/jsmaniac/journal-article/master.svg)](https://travis-ci.org/jsmaniac/journal-article)
[![Build Stats,](https://img.shields.io/website-stats-stats%20unavailable-blue-red/https/jsmaniac.github.io/travis-stats/.svg?label=build)](http://jsmaniac.github.io/travis-stats/#jsmaniac/journal-article)
[![Try our Tool Online](https://img.shields.io/website-online-currently%20unavailable-blue-red/http/ajl-demo.fr/2016/.svg?label=try%20our%20tool)](http://ajl-demo.fr/2016/)
[![Read Online (PDF)](https://img.shields.io/website-PDF-PDF%20unavailable-blue-red/https/jsmaniac.github.io/journal-article-gh-pages/main.pdf.svg?label=read%20online)](https://jsmaniac.github.io/journal-article-gh-pages/main.pdf)
# journal-article
This repository contains the LaTeX code for our upcoming journal article.

50
auto-push-gh-pages.sh Executable file
View File

@ -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

0
biblio.bib Executable file → Normal file
View File

Binary file not shown.