Automate your Awesome-CV with XeLaTeX and Gitlab CI

Continuous Integration for your Awesome-CV

Image by Me on Sérgio Mendonça’s website

Gitlab CI

There are numerous tutorials and documentation to learn Gitlab CI/CD. It’s enough you just google it. :p

Everyone who knows LaTeX will probably complain now because I could just use Overleaf to edit my CV in the browser. That’s totally correct, but I want to use Gitlab CI to present you with a simple exercise on Gitlab Continuous Integration.

I forked the official Awesome-CV repository into my own Gitlab. Everything that builds your Awesome-CV automatically can be found in the .gitlab-ci.yml file.

pdf:
  image: thomasweise/texlive
  script:
    - cd examples
    - xelatex cv.tex
  artifacts:
    paths:
    - examples/cv.pdf

Explanation

By adding this file into the root directory of the repository a GitLab runner will execute the defined tasks.

  • pdf defines the name of the runner job.

    • image: The runner starts the docker image that has texlive installed, labeled thomasweise/texlive;

    • Everything in script will be executed in the docker container. Just like we use XeLaTeX on our local machine;

      • The runner will switch to the examples folder and;
      • Execute xelatex cv.tex;
    • That will generate a PDF file - if no error occurred.

      • To obtain the generated PDF file we have to define the file as an artifact. The artifacts can be downloaded into a zipfile or browse to examples/cv.pdf, if the job has finished successfully.

The jobs for my repository can be found here.

In the README.md the status of the pipeline is displayed and direct links to the artifacts can be found. Have a look at the official documentation for the badges.

# My Awesome-CV

[![pipeline status](https://gitlab.com/sftom/Awesome-CV/badges/master/pipeline.svg)](https://gitlab.com/sftom/Awesome-CV/-/commits/master)

[Browse](https://gitlab.com/sftom/Awesome-CV/builds/artifacts/master/browse?job=pdf) the Artifacts or [download](https://gitlab.com/sftom/Awesome-CV/-/jobs/artifacts/master/raw/examples/cv.pdf?job=pdf) the PDF directly.

I forked from [Awesome-CV repository](https://github.com/posquit0/Awesome-CV) into my own space on GitLab.

If you want to build your own Awesome-CV with Gitlab CI feel free to fork my repository and start editing the files in the customizing branch.

Adapted by LARS LÜHR, Blogging about coding, security and photography.

Sergio Mendonca
Sergio Mendonca
Professor of Computer Science

My research interests include the Internet of Things, Blockchain and Cryptocurrencies, Cryptography and Network Security, Computer Simulations, and Programming.

comments powered by Disqus