.gitlab-ci.yml 8.12 KB
Newer Older
1
2
services:
  - postgres:9.4
3

Alexandre Morin's avatar
Alexandre Morin committed
4
stages:
5
  - tests
Alexandre Morin's avatar
Alexandre Morin committed
6
  - push
Alexandre Morin's avatar
Alexandre Morin committed
7

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

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

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#unit-tests:php-7.3:
#  image: php:7.3-apache
#  stage: tests
#  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
#  script:
#    - useradd -m -g www-data maarch
#    - export APACHE_RUN_USER=maarch
#    - mkdir -p /var/www/html/
#    - cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
#    - mv /var/www/maarchRM/ /var/www/laabs/
#    - cd /var/www/laabs
#    - 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
#    - 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
#    - cd /etc/apache2/sites-available/
#    - touch maarchRM.conf
#    - echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
#    - a2ensite maarchRM.conf
#    - a2dissite 000-default.conf
#    - a2enmod rewrite
#    - a2enmod env
#    - service apache2 start
#    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
#    - chmod +x /usr/local/bin/phpunit
#    - phpunit --coverage-text --colors=never -c /var/www/laabs/phpunit.xml
#  except:
#    - master
#
#unit-tests:php-7.2:
#  image: php:7.2-apache
#  stage: tests
#  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
#  script:
#    - useradd -m -g www-data maarch
#    - export APACHE_RUN_USER=maarch
#    - mkdir -p /var/www/html/
#    - cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
#    - mv /var/www/maarchRM/ /var/www/laabs/
#    - cd /var/www/laabs
#    - 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
#    - 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
#    - cd /etc/apache2/sites-available/
#    - touch maarchRM.conf
#    - echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
#    - a2ensite maarchRM.conf
#    - a2dissite 000-default.conf
#    - a2enmod rewrite
#    - a2enmod env
#    - service apache2 start
#    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
#    - chmod +x /usr/local/bin/phpunit
#    - phpunit --coverage-text --colors=never -c /var/www/laabs/phpunit.xml
#  only:
#    - develop
#
#unit-tests:php-7.1:
#  image: php:7.1-apache
#  stage: tests
#  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
#  script:
#    - useradd -m -g www-data maarch
#    - export APACHE_RUN_USER=maarch
#    - mkdir -p /var/www/html/
#    - cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
#    - mv /var/www/maarchRM/ /var/www/laabs/
#    - cd /var/www/laabs
#    - 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
#    - 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
#    - cd /etc/apache2/sites-available/
#    - touch maarchRM.conf
#    - echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
#    - a2ensite maarchRM.conf
#    - a2dissite 000-default.conf
#    - a2enmod rewrite
#    - a2enmod env
#    - service apache2 start
#    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
#    - chmod +x /usr/local/bin/phpunit
#    - phpunit --coverage-text --colors=never -c /var/www/laabs/phpunit.xml
#  only:
#    - develop
#
#unit-tests:php-7.0:
#  image: php:7.0-apache
#  stage: tests
#  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
#  script:
#    - useradd -m -g www-data maarch
#    - export APACHE_RUN_USER=maarch
#    - mkdir -p /var/www/html/
#    - cp -R /builds/maarch/maarchRM/ /var/www/maarchRM/
#    - mv /var/www/maarchRM/ /var/www/laabs/
#    - cd /var/www/laabs
#    - 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
#    - 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
#    - cd /etc/apache2/sites-available/
#    - touch maarchRM.conf
#    - echo "Include /var/www/laabs/data/maarchRM/conf/vhost.conf" >> maarchRM.conf
#    - a2ensite maarchRM.conf
#    - a2dissite 000-default.conf
#    - a2enmod rewrite
#    - a2enmod env
#    - service apache2 start
#    - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-7.phar
#    - chmod +x /usr/local/bin/phpunit
#    - phpunit --coverage-text --colors=never -c /var/www/laabs/phpunit.xml
#  only:
#    - develop
173

Alexandre Morin's avatar
Alexandre Morin committed
174
functional-test:cypress:
Alexandre Morin's avatar
Alexandre Morin committed
175
  image: cypress/base:10
176
  stage: tests
Alexandre Morin's avatar
Alexandre Morin committed
177
  script:
178
179
    - mv /builds/maarch/maarchRM/cypress.json /builds/maarch/maarchRM/cypress.json.old
    - mv /builds/maarch/maarchRM/cypress.json.ci /builds/maarch/maarchRM/cypress.json
Alexandre Morin's avatar
Alexandre Morin committed
180
181
    - npm ci
    - $(npm bin)/cypress verify
Alexandre Morin's avatar
Alexandre Morin committed
182
    - $(npm bin)/cypress run
Alexandre Morin's avatar
Alexandre Morin committed
183
184
  only:
    - schedules
185
    - develop
Alexandre Morin's avatar
Alexandre Morin committed
186
187
188
189
190
191
  artifacts:
    expire_in: 1 week
    when: always
    paths:
      - cypress/screenshots
      - cypress/videos
Alexandre Morin's avatar
Alexandre Morin committed
192

193
syntax-test:php-metrics:
194
195
196
  image: jakzal/phpqa
  stage: tests
  script: phpmetrics --report-html=var/php-metrics src
197
198
  except:
    - schedules
Alexandre Morin's avatar
Alexandre Morin committed
199
200
  only:
    - develop
201
202
203
204
205
  artifacts:
    paths:
      - var/php-metrics/
  allow_failure: true

206
syntax-test:php-phpmd:
207
208
  image: jakzal/phpqa
  stage: tests
209
210
  script:
    - mkdir var/
Alexandre Morin's avatar
Alexandre Morin committed
211
    - phpmd src html phpmd.xml --reportfile var/phpmd.html --exclude --ignore-violations-on-exit
212
213
  except:
    - schedules
Alexandre Morin's avatar
Alexandre Morin committed
214
215
  only:
    - develop
216
217
  artifacts:
    paths:
218
      - var/phpmd.html
219
220
  allow_failure: true

221
222

syntax-test:php-deprecation-detector:
223
224
  image: jakzal/phpqa
  stage: tests
Alexandre Morin's avatar
Alexandre Morin committed
225
  script:
226
    - deprecation-detector check src vendor/
227
228
  except:
    - schedules
Alexandre Morin's avatar
Alexandre Morin committed
229
230
  only:
    - develop
231
232
  allow_failure: true

233

234
235
236
237
238
#build-dockerhub:
#  stage: push
#  script:
#    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
#    - docker build dockerfile/version/ -t "$CI_REGISTRY_IMAGE"
239
#    - docker tag "$CI_REGISTRY_IMAGE"
240
241
242
243
244
#    - docker push "$CI_REGISTRY_IMAGE"
#  only:
#    - feat/gitlab_ci
#  except:
#    - schedules