A docker container for Gitlab CI to build with Latex.
This container builds monthly. It uses the full, current texlive installation.
You can find this container at niccokunzmann/ci-latex. You can pull it with
docker pull niccokunzmann/ci-latex
You can build the container yourself using the docker
command:
docker build -t niccokunzmann/ci-latex .
Suppose you are in the console in the folder where your
paper.tex
should be built, so ls
shows paper.tex
.
Run this, to build the file.
docker run -v "`pwd`:/thesis" --rm -it niccokunzmann/ci-latex bash -c 'cd thesis; pdflatex paper.tex'
You can use the container in your runner like this:
image: niccokunzmann/ci-latex
If you paper is in the root folder of the repository and named paper.tex
, your .gitlab-ci.yml
can look like this:
image: niccokunzmann/ci-latex
stages:
- deploy
expose:
stage: deploy
script:
- pdflatex -interaction=nonstopmode -halt-on-error paper.tex
artifacts:
paths:
- paper.pdf
See the documentation for how to change your .gitlab-ci.yml
.
Example .travis.yml
derived from 12 characters translations.
We assume that there is a file names paper.tex
at the root of your repository.
language: ruby
services:
- docker
before_install:
- docker pull niccokunzmann/ci-latex
script:
- docker run -v "`pwd`:/thesis" --rm -it niccokunzmann/ci-latex bash -c 'cd thesis; pdflatex paper.tex'
deploy:
provider: releases
api_key:
secure: "... secure api key https://stackoverflow.com/a/12778315 ..."
file:
- paper.pdf
skip_cleanup: true
on:
branch: master
If the repository build fails, this can be due to an outdated
installation.profile
.
You can get the installation commands from the Dockerfile
,
create the texlive.profile
and then copy it over the
installation.profile
.