{"id":157,"date":"2019-10-31T03:58:00","date_gmt":"2019-10-31T08:58:00","guid":{"rendered":"http:\/\/127.0.0.1:8080\/?p=157"},"modified":"2024-01-13T11:59:35","modified_gmt":"2024-01-13T16:59:35","slug":"latex-drone-ci-minio-cmake","status":"publish","type":"post","link":"http:\/\/10.42.0.68:8080\/blog\/latex-drone-ci-minio-cmake","title":{"rendered":"LaTeX + Drone CI + Minio + CMake"},"content":{"rendered":"\n

I like LaTeX for content structure separated from style.<\/p>\n\n\n\n

Let’s go, Right now, we’re doing inside how I build this CI\/CD.<\/p>\n\n\n\n\n\n\n\n

Which and why<\/h1>\n\n\n\n

latex-builder<\/h2>\n\n\n\n

What is it?<\/p>\n\n\n\n

It’s my Docker image sycured\/latex-builder<\/a> \/ Buildah script<\/a> based on archlinux which include all I need to build my LaTeX documents.<\/p>\n\n\n\n

I include my pdfcompressor<\/a> to compress PDF files.<\/p>\n\n\n\n

Drone CI<\/h1>\n\n\n\n

Drone CI<\/a> is the easiest and powerful CI\/CD that I tested and it’s written in Go<\/a>. In addition, Drone CLI<\/a> permits you to run your .drone.yml<\/em> on your computer using Docker without necessitating to push to the repository (command: drone exec<\/code>).<\/p>\n\n\n\n

MinIO<\/h1>\n\n\n\n

It’s good to save artifacts from CI\/CD, I use MinIO<\/a> (S3 compatible).<\/p>\n\n\n\n

I created a dedicated bucket and inside I put artifacts from CI\/CD inside the right folder.<\/p>\n\n\n\n

For my CV, the folder cv is read-only for anonymous access; it’s perfect to always share the latest version.<\/p>\n\n\n\n

CMake<\/h1>\n\n\n\n

My ultimate weapon about compiling LaTeX documents, I use one CMake module: UseLATEX<\/a>.<\/p>\n\n\n\n

You need to write a CMakeLists.txt like:<\/p>\n\n\n\n

cmake_minimum_required(VERSION 2.8.4)\n\nproject(cv NONE)\ninclude(UseLATEX)\n\nfile(GLOB_RECURSE english_files RELATIVE ${CMAKE_SOURCE_DIR} english\/*.tex)\nfile(GLOB_RECURSE english-new_files RELATIVE ${CMAKE_SOURCE_DIR} english-new\/*.tex)\n\nadd_latex_document(\n    english.tex\n    INPUTS ${english_files}\n    FORCE_PDF\n    )\n\nadd_latex_document(\n    english-new.tex\n    INPUTS ${english-new_files}\n    FORCE_PDF\n    )<\/code><\/pre>\n\n\n\n

How to use it in CI\/CD?<\/h2>\n\n\n\n

I include a shell script: run.sh<\/code><\/p>\n\n\n\n

#!\/bin\/bash\nBD=\"\/tmp\/build_cv\"\nCD=`pwd`\nrm -rf \"$BD\" ; mkdir \"$BD\" && cd \"$BD\" && cmake -G Ninja \"$CD\" && ninja && \\\npdfcompressor -2 -o cv-en.pdf -i english.pdf && \\\npdfcompressor -2 -o cv-en-new.pdf -i english-new.pdf<\/code><\/pre>\n\n\n\n

What’s ninja?<\/h2>\n\n\n\n

Why using this old make<\/em> with CMake?<\/p>\n\n\n\n

No reason, you can use CMake with steroid: Ninja<\/p>\n\n\n\n

\n

Ninja is a small build system with a focus on speed – https:\/\/ninja-build.org\/<\/a><\/p>\n<\/blockquote>\n\n\n\n

I need performance (rewriting pdfcompressor to optimize speed: roadmap)<\/p>\n","protected":false},"excerpt":{"rendered":"

I like LaTeX for content structure separated from style. Let’s go, Right now, we’re doing inside how I build this CI\/CD.<\/p>\n","protected":false},"author":1,"featured_media":82,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[14],"tags":[15,11,16],"_links":{"self":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts\/157"}],"collection":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/comments?post=157"}],"version-history":[{"count":1,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts\/157\/revisions"}],"predecessor-version":[{"id":158,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/posts\/157\/revisions\/158"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/media\/82"}],"wp:attachment":[{"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/media?parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/categories?post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10.42.0.68:8080\/wp-json\/wp\/v2\/tags?post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}