Automation

Use gitlab CI

Installation and configuration of runner

Runner : configuration

# gitlab-runner register

Runtime platform arch=amd64 os=linux pid=2379 revision=1f513601 version=11.10.1
Running in system-mode.                            
                                                   
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.maison.lan/

Please enter the gitlab-ci token for this runner:
aaayR5FYoHVXJsFAn7Y6

Please enter the gitlab-ci description for this runner:
[runner]: 

Please enter the gitlab-ci tags for this runner (comma separated):
docker,shell,security

Registering runner... succeeded                     runner=bdkyR5FY

Please enter the executor: parallels, ssh, docker+machine, docker-ssh+machine, docker, docker-ssh, shell, virtualbox, kubernetes:
[docker+ssh+machine]: docker 

Please enter the default Docker image (e.g. ruby:2.1):
debian:stretch-slim

Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 

Project : add .gitlab-ci.yml

Very important the tags must match the tags of the runner otherwise the job will never start

test:
  script:
    - echo "Tests en cours"
  tags:
    - docker

build:
  script:
    - echo "Build en cours"
  tags:
    - docker
deploy:
  script:
    - echo "Déploiement de l'application"
  tags:
    - docker