-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
90 lines (83 loc) · 2.74 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
#image: "php:7.4-apache-buster"
image: "registry.gitlab.com/fapariciorteam/ddd-symfony4-boilerplate:latest"
# Cache libraries in between jobs
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/
- bin
- var
- node_modules
before_script:
- apt -y update
- a2enmod rewrite
# - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# - php composer-setup.php
# - php -r "unlink('composer-setup.php');"
# - mv composer.phar /usr/local/bin/composer
# - curl -sS https://get.symfony.com/cli/installer | bash
# - mv /root/.symfony/bin/symfony /usr/local/bin
# - apt -y install git libzip-dev unzip
# - docker-php-ext-install zip
# - pecl install xdebug-2.9.4
# - echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
# - echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini
# - echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini
# - apt -y install nodejs npm
# - npm install npm@latest -g
# - apt -y install libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
build php:
stage: build
script: sh ./.gitlabci/build.sh
rules:
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
- if: $CI_MERGE_REQUEST_ID
build javascript:
stage: build
script: npm install
rules:
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
- if: $CI_MERGE_REQUEST_ID
unit test:
stage: test
script: sh ./.gitlabci/unit-test.sh
rules:
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
- if: $CI_MERGE_REQUEST_ID
artifacts:
paths:
- build
- doc/hugo/public
expire_in: 1 hour
after_script:
- sh ./.gitlabci/test-hugo-pages.sh
functional test:
stage: test
script: sh ./.gitlabci/functional-test.sh
rules:
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
- if: $CI_MERGE_REQUEST_ID
artifacts:
paths:
- cypress/videos
- cypress/screenshots
- cypress/reports/mochareports
when: always
expire_in: 1 hour
after_script:
- npm run posttest
pages:
before_script:
- echo "Do nothing in this stage"
stage: deploy
dependencies:
- unit test
- functional test
script:
- bash ./.gitlabci/deploy-pages.sh
artifacts:
paths:
- public
expire_in: 1 day
only:
- master