Skip to content

DockerTravisCI

Etienne DELAY edited this page Apr 20, 2018 · 4 revisions

Docker

From wikipedia Docker is " it uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces, and a union-capable file system such as OverlayFS and others to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines (VMs). "

Our purpose is to use dockor in order to run pillar outside your computeur and generate PDF.

This a contener engine, is avalable for all platform. Most of information about installation can be found on this page.

Docker syntax

Run a docker

docker run --name contnerName vmOnDockerHub

In our case it will be

docker run --tty --rm --volume $PWD:/work dpollet/texlive:pillar bash -c "make spiralbook"

  • --tty for log in to your container using TTY
  • --rm remove contener when it's done
  • --volume mount a volume inside docker running $PWD for host directory and /work place inside docker.
  • bash -c allow you to send bash command

Travis

Travis- toolkit

Some stuff need to be configure on travis-cu website. After that,

You need to produce a .travis.yml to drive travis durnig the ci phase. To help the .travis.yml file construction you can install a toolkit developped in ruby : Travis Command-line Tool

  • Install the command-line tool : gem install travis -v 1.7.5 --no-rdoc --no-ri

Generate .travis.yml

  • Run the command-line tool inside your github reprository to generate encrypted key well formated : travis setup releases

It will generate some thing like :

sudo: required
services:
- docker
before_install:
- docker pull dpollet/texlive:pillar
script:
- docker run --tty --rm --volume $PWD:/work dpollet/texlive:pillar bash -c "make spiralbook"
deploy:
  provider: releases
  api_key:
    secure: aqE5qPyTMKbklg+io867S2cgRYBqHA30/+GnIkPj7je7bRrhmXqi+NVuZRp0TXxhhVdSanQrdGOtza/4PbTwqz15NbiLLk6aJ5jeOHRGwLhyGIUqv/JDU/rgzc+4t0H7A070ARgZ3aIaCAj3g3Iq/ph8FrfU4+jHXuzsrlwVzQz15xZWUVB7tn6wCh6JCj6jYXJKpjDc8n1NJWHcF19bOBvol7qUWbLdfkUgW78rcDS9bTugro7REaDCA3WTtB1njc3diD52NJrM1QsLa/FQo0i3eWdHpF3ZHNiEHSV4tBReXXanaWpVU/Lcvg0dAgbtyn1oda2XajBPLtp4MvxNBb8MlfsUqoyBd6fgXw1hjRDUGM2a/FBNqenB5aOcxXiduEE1/3WTmdMkKtQk+SiaOec9QGmfY26553yZAc2/XPW5ImB05t5OmBFD04JRnmwO3R7wOHw6N+tVEpAIrYjabiG+6zl7igrCNR9WLJ4PecMc5LCL7uHQGCun6trzDLK3v29CBQVqgK81Hlbqm+A3E0ajwoEaqInhuip1HrU4sIjL+XJG2g0XEjgIZBs5GcdTemQr0mwvUcNXn8yVEnL2II8bLt/pLLlIT68jOOk4LPx4iKROgzkY8ZCaPnhdB2w1mRzdOI0Ct3ObXdaAKIcgbvBqfNJydLosvEjykTuJ/t8=
  file: build/book.spiral.pdf
  skip_cleanup: true
  on:
repo: cormas/Booklet-CORMAS
Clone this wiki locally