You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1.6 KiB

Gitlab CI

Tests & co

Maintenant qu'on a des process de vérification, on peut les faire tourner "tout le temps".

Slides

Exemple de GitlabCI

image: edbizarro/gitlab-ci-pipeline-php:7.4-alpine

services:
  - mysql:5.7

before_script:
  - composer install -n --prefer-dist

variables:
  # For MySQL service
  MYSQL_DATABASE: "gitlab_test"
  MYSQL_ROOT_PASSWORD: "test"
  # For CakePHP App
  DATABASE_HOST: "mysql"
  DATABASE_DB: "gitlab_test"
  DATABASE_TEST_DB: "gitlab_test"
  DATABASE_USER: "root"
  DATABASE_PASSWORD: "test"
  MAIL_FROM: "gitlabci@cef.fr"

cache:
  paths:
    - ./vendor/

job:runtests:
  stage: test
  script:
    - composer run test -- --log-junit junit.xml
  artifacts:
    reports:
      junit: junit.xml

job:codesniffer:
  stage: test
  script:
    - composer run cs-check -- --report=junit --report-file=codesniffer.xml
  artifacts:
    reports:
      junit: codesniffer.xml

Déploiement

Joel Test - Question #2

Exemple de GitlabCI vers Dokku

job:deploy:
  stage: deploy
  image: ilyasemenov/gitlab-ci-git-push
  services: []
  before_script: []
  environment:
    name: staging
    url: https://$DOKKU_APP_NAME.tests.iteracode.com
  script:
    - git-push dokku@tests.iteracode.com:$DOKKU_APP_NAME
  only:
    - dev

Build Docker image on Gitlab CI

Doc officielle

Build + Deploy