Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.71 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,manual,manual_attachments,templates,acknowledgement_receipts}
  - mkdir -p /opt/maarch/docservers/{convert_attachments,convert_attachments_version,convert_mlb}
  - mkdir -p /opt/maarch/docservers/{fulltext_attachments,fulltext_attachments_version,fulltext_mlb}
  - mkdir -p /opt/maarch/docservers/{thumbnails_attachments,thumbnails_attachments_version,thumbnails_mlb}
  - 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
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
Giovannoni Laurent's avatar
Giovannoni Laurent committed

job_e2e:
 image: php:7.4-apache
 stage: test
 script:
Florian Azizian's avatar
Florian Azizian committed
   - service apache2 start
Florian Azizian's avatar
Florian Azizian committed
   - touch installed.lck
Florian Azizian's avatar
Florian Azizian committed
   - chown -R www-data. /opt/maarch/
   - chown -R www-data. /var/www/html/
   - chmod -R 775 /opt/maarch/
   - chmod -R 775 /var/www/html/
   - curl -sL https://deb.nodesource.com/setup_13.x | bash - > /dev/null
   - apt-get install -yqq nodejs > /dev/null
   - npm install npm@latest -g 
   - npm set registry https://registry.npmjs.org/ 
Florian Azizian's avatar
Florian Azizian committed
   - npm install > /dev/null
   - npm run build-prod
   - curl -o /dev/null --silent --head --write-out '%{http_code}\n' http://127.0.0.1/MaarchCourrier
   - firefox --version
   - npm run ee-launch
 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
job_php-7.2:
  image: php:7.2-apache
  stage: test
  script:
    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-8.phar
    - chmod +x /usr/local/bin/phpunit
    - phpunit --coverage-text --colors=never
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