.gitlab-ci.yml 1.89 KB
services:
  - postgres:latest

variables:
  POSTGRES_DB: "MaarchCourrier"
  POSTGRES_USER: maarch
  POSTGRES_PASSWORD: ""

stages:
  - test

before_script:
  - apt-get update > /dev/null
  - apt-get install wget -yqq > /dev/null
  - apt-get install npm -yqq > /dev/null
  - apt-get install git -yqq > /dev/null
  - bash ci/docker_install_php.sh > /dev/null
  - bash ci/docker_install_database.sh > /dev/null
  - wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
  - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  - php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  - php composer-setup.php
  - php -r "unlink('composer-setup.php'); unlink('installer.sig');"
  - php composer.phar install
  - mv composer.phar /usr/local/bin/composer
  - chmod +x /usr/local/bin/composer

job_php-7.0:
  image: php:7.0-apache
  stage: test
  script:
    - mkdir -p /var/www/html/
    - cp -R /builds/maarch/MaarchCourrier/ /var/www/html/
    - cd /var/www/html/MaarchCourrier
    - mkdir -p /var/www/html/MaarchCourrier
    - composer -n install
    - npm install --production
    - sed 's/<databaseserver>.*<\/databaseserver>/<databaseserver>postgres<\/databaseserver>/;s/<databasepassword>.*<\/databasepassword>/<databasepassword><\/databasepassword>/;s/<databasename>.*<\/databasename>/<databasename>MaarchCourrier<\/databasename>/;s/<databaseuser>.*<\/databaseuser>/<databaseuser>maarch<\/databaseuser>/' apps/maarch_entreprise/xml/config.xml.default > apps/maarch_entreprise/xml/config.xml
    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
    - chmod +x /usr/local/bin/phpunit
    #- cd App/MaarchRM
    - phpunit --coverage-text --colors=never -c phpunit.xml
  only:
    - develop