.gitlab-ci.yml 2.19 KB
Newer Older
Alexandre Morin's avatar
Alexandre Morin committed
1
2
3
4
5
6
7
services:
  - postgres:9.4

variables:
  POSTGRES_DB: "maarchRM"
  POSTGRES_USER: maarch
  POSTGRES_PASSWORD: ""
Alexandre Morin's avatar
Alexandre Morin committed
8
  npm_config_cache: /builds/cypress-io/cypress-example-docker-gitlab/.npm
Alexandre Morin's avatar
Alexandre Morin committed
9
  CYPRESS_CACHE_FOLDER:  ~/.cache/Cypress
Alexandre Morin's avatar
Alexandre Morin committed
10

Alexandre Morin's avatar
Alexandre Morin committed
11
12

stages:
Alexandre Morin's avatar
Alexandre Morin committed
13
  - build
Alexandre Morin's avatar
Alexandre Morin committed
14
15
  - test

Alexandre Morin's avatar
Alexandre Morin committed
16
17
18
19
20
21
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .npm
    - cache/Cypress
    - node_modules
Alexandre Morin's avatar
Alexandre Morin committed
22

Alexandre Morin's avatar
Alexandre Morin committed
23
job_build_php-7.3:
Alexandre Morin's avatar
Alexandre Morin committed
24
  image: php:7.3-apache
Alexandre Morin's avatar
Alexandre Morin committed
25
26
27
28
29
30
31
32
33
  stage: build
  before_script:
    - apt-get update > /dev/null
    - mkdir -p /usr/share/man/man1
    - mkdir -p /usr/share/man/man7
    - apt-get install cron -yqq > /dev/null
    - apt-get install libreoffice -yqq > /dev/null
    - bash ci/docker_install_php.sh > /dev/null
    - bash ci/docker_install_database.sh > /dev/null
Alexandre Morin's avatar
Alexandre Morin committed
34
  script:
35
36
    - useradd -m -g www-data maarch
    - export APACHE_RUN_USER=maarch
Alexandre Morin's avatar
Alexandre Morin committed
37
    - mkdir -p /var/www/html/
Alexandre Morin's avatar
Alexandre Morin committed
38
    - cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
Alexandre Morin's avatar
Alexandre Morin committed
39
40
    - mv /var/www/maarchRM/ /var/www/laabs/
    - cd /var/www/laabs
Alexandre Morin's avatar
Alexandre Morin committed
41
42
43
    - cp data/maarchRM/conf/vhost.conf.default data/maarchRM/conf/vhost.conf
    - cp data/maarchRM/conf/configuration.ini.default data/maarchRM/conf/configuration.ini
    - cp data/maarchRM/conf/confvars.ini.default data/maarchRM/conf/confvars.ini
Alexandre Morin's avatar
Alexandre Morin committed
44
    - >
Alexandre Morin's avatar
Alexandre Morin committed
45
      sed -i -e 's!"baseUrl" : "http://maarchrm"!"baseUrl" : "http://localhost"!' /var/www/laabs/cypress.json
46
47
48
    - mkdir -p /var/www/laabs/data/maarchRM/repository/archives_1 /var/www/laabs/data/maarchRM/repository/archives_2
    - chown -R maarch:www-data /var/www
    - chmod -R 775 /var/www
Alexandre Morin's avatar
Alexandre Morin committed
49
    - cd /etc/apache2/sites-available/
50
51
52
53
    - touch maarchRM.conf
    - echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
    - a2ensite maarchRM.conf
    - a2dissite 000-default.conf
Alexandre Morin's avatar
Alexandre Morin committed
54
55
    - a2enmod rewrite
    - a2enmod env
Alexandre Morin's avatar
Alexandre Morin committed
56
    - service apache2 start
Alexandre Morin's avatar
Alexandre Morin committed
57
58
    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
    - chmod +x /usr/local/bin/phpunit
Alexandre Morin's avatar
Alexandre Morin committed
59
60
61
  except:
    - master

Alexandre Morin's avatar
Alexandre Morin committed
62
functional-test:cypress-e2e:
Alexandre Morin's avatar
Alexandre Morin committed
63
64
65
  image: cypress/base:10
  stage: test
  script:
Alexandre Morin's avatar
Alexandre Morin committed
66
    - $(npm bin)/cypress install
Alexandre Morin's avatar
Alexandre Morin committed
67
    - $(npm bin)/cypress verify
Alexandre Morin's avatar
Alexandre Morin committed
68
69
70
71
72
73
74
    - $(npm bin)/cypress run
  artifacts:
    expire_in: 1 week
    when: always
    paths:
      - cypress/screenshots
      - cypress/videos