Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.4 KiB
Newer Older
Giovannoni Laurent's avatar
Giovannoni Laurent committed
services:
  - name: postgres:10.1
    command: ["-c", "datestyle=iso,dmy"]
Florian Azizian's avatar
Florian Azizian committed
  - httpd:latest
Giovannoni Laurent's avatar
Giovannoni Laurent committed

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

stages:
  - test
Giovannoni Laurent's avatar
Giovannoni Laurent committed

before_script:
Florian Azizian's avatar
Florian Azizian committed
  - apt-get update -yqq > /dev/null
Giovannoni Laurent's avatar
Giovannoni Laurent committed
  - mkdir -p /usr/share/man/man1
  - mkdir -p /usr/share/man/man7
  #- apt-get install apt-utils -yqq > /dev/null
  - apt-get install cron -yqq > /dev/null
  #- apt-get install tar -yqq > /dev/null
Giovannoni Laurent's avatar
Giovannoni Laurent committed
  #- apt-get install wkhtmltopdf -yqq > /dev/null
  #- apt-get install wget -yqq > /dev/null
  #- wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  #- tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
  #- mv wkhtmltox/bin/wkhtmlto* /usr/bin
  #- chmod +x /usr/bin/wkhtmlto*
Florian Azizian's avatar
Florian Azizian committed
  #- apt-get install libreoffice -yqq > /dev/null 
Giovannoni Laurent's avatar
Giovannoni Laurent committed
  - apt-get install git -yqq > /dev/null
  - bash ci/docker_install_php.sh > /dev/null
  - bash ci/docker_install_database.sh > /dev/null
Florian Azizian's avatar
Florian Azizian committed
  - mkdir -p /opt/maarch/docservers/indexes/{letterbox_coll,attachments_coll,version_attachments_coll}
  - mkdir -p /opt/maarch/docservers/{ai,resources,attachments,templates,acknowledgement_receipts}
  - mkdir -p /opt/maarch/docservers/{convert_attachments,convert_resources}
  - mkdir -p /opt/maarch/docservers/{fulltext_attachments,fulltext_resources}
  - mkdir -p /opt/maarch/docservers/{thumbnails_attachments,thumbnails_resources}
Florian Azizian's avatar
Florian Azizian committed
  - mkdir -p /var/www/html/
  - ln -s $CI_PROJECT_DIR /var/www/html/MaarchCourrier
  - cd /var/www/html/MaarchCourrier
Damien's avatar
Damien committed
  - sed 's/127.0.0.1/postgres/' apps/maarch_entreprise/xml/config.json.default > apps/maarch_entreprise/xml/config.json
  - sed -i 's/\"lockAdvancedPrivileges\"\ \:\ true/\"lockAdvancedPrivileges\"\ \:\ false/' apps/maarch_entreprise/xml/config.json
Florian Azizian's avatar
Florian Azizian committed
  - cp modules/visa/xml/remoteSignatoryBooks.xml.default modules/visa/xml/remoteSignatoryBooks.xml
  - apt-get install -yqq openjdk-11-jdk > /dev/null
  - sed -i 's/rights="none" pattern="PDF"/rights="read | write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
Giovannoni Laurent's avatar
Giovannoni Laurent committed

job_e2e:
 image: php:7.4-apache
 stage: test
 script:
   - curl -sL https://deb.nodesource.com/setup_14.x | bash - > /dev/null
   - apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
   - apt-get install -yqq nodejs > /dev/null
   - npm install npm@latest -g 
Alex ORLUC's avatar
Alex ORLUC committed
   - node -v
   - npm set registry https://registry.npmjs.org/ 
Florian Azizian's avatar
Florian Azizian committed
   - npm install > /dev/null
   - npm run cypress:run
 artifacts:
   paths:
Florian Azizian's avatar
Florian Azizian committed
     - queries_error.log
     - test/e2e/screenshots/
Florian Azizian's avatar
Florian Azizian committed
 only:
   - schedules
job_php-7.4:
 image: php:7.4-apache
 stage: test
 script:
Damien's avatar
Damien committed
   - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
   - chmod +x /usr/local/bin/phpunit
   - phpunit --coverage-text --colors=never
 only:
   - develop
Florian Azizian's avatar
Florian Azizian committed
 except:
   - schedules
Florian Azizian's avatar
Florian Azizian committed
 artifacts:
   paths:
Florian Azizian's avatar
Florian Azizian committed
     - test/unitTests/build/
job_php-7.3:
 image: php:7.3-apache
 stage: test
 script:
Damien's avatar
Damien committed
   - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
Florian Azizian's avatar
Florian Azizian committed
   - chmod +x /usr/local/bin/phpunit
   - phpunit --coverage-text --colors=never
 only:
   - develop
Florian Azizian's avatar
Florian Azizian committed
 except:
   - schedules
#pages:
#  stage: deploy
#  dependencies:
#    - job_php-7.4
#  before_script:
#    - pwd
#  script:
#    - mv test/unitTests/build/ public/
#  artifacts:
#    paths:
#      - public
#    expire_in: 1 day
#  only:
#    - develop