forked from coreshop/CoreShop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
82 lines (67 loc) · 2.97 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
image: php:7.0
# Select what we should cache
cache:
paths:
- vendor/
before_script:
# Move cloned stuff
- mkdir $CI_PROJECT_DIR/../lib
- mkdir $CI_PROJECT_DIR/../lib/CoreShop
- mv $CI_PROJECT_DIR/{.[!.],}* $CI_PROJECT_DIR/../lib/CoreShop
- rm -rf $CI_PROJECT_DIR
- mkdir -p $CI_PROJECT_DIR/
- cd $CI_PROJECT_DIR
# Install git, the php image doesn't have installed
- apt-get update -yqq
- apt-get install git -yqq
- apt-get install zlib1g-dev libicu-dev g++ libmcrypt-dev libldap2-dev libxml2-dev bzip2 unzip memcached ntpdate libxrender1 libfontconfig1 libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev build-essential curl libcurl3 libcurl3-dev -yqq
# Copy PHP INI
- cp $CI_PROJECT_DIR/../lib/CoreShop/.gitlab-ci/php.ini /usr/local/etc/php/php.ini
# Install PHP Extensions
- docker-php-ext-install pdo_mysql
- docker-php-ext-install zip mcrypt bcmath curl exif xml simplexml mbstring
- docker-php-ext-configure intl
- docker-php-ext-install intl
- docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
- docker-php-ext-install -j$(nproc) gd
# Clone Pimcore
- git clone --depth 1 https://github.com/pimcore/pimcore.git $CI_PROJECT_DIR
- mv $CI_PROJECT_DIR/../lib $CI_PROJECT_DIR
- ls -la $CI_PROJECT_DIR/lib/CoreShop
- cd $CI_PROJECT_DIR/lib/CoreShop
- git branch --no-color --no-abbrev -v
- git log -n1 --pretty=%H
- cd $CI_PROJECT_DIR
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Add Composer Path to Repo
- php composer.phar config repositories.coreshop path lib/CoreShop
- cat composer.json
#######################################################################
###### This is the part where it should be alike with Travis ##########
#######################################################################
# add config templates (needed for composer install, otherwise symfony throws an exception)
- mkdir -p var/config
- cp .travis/system.template.php var/config/system.php
- cp app/config/parameters.example.yml app/config/parameters.yml
# install composer
- php composer.phar require coreshop/core-shop:dev-master#$CI_COMMIT_REF --ignore-platform-reqs
services:
- mysql
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: coreshop_phpunit
MYSQL_ROOT_PASSWORD: root
CORESHOP_MYSQL_HOST: mysql
CORESHOP_MYSQL_DB: coreshop_phpunit
CORESHOP_MYSQL_USER: root
CORESHOP_MYSQL_PWD: root
# We test PHP7.0 (the default) with MySQL
test:mysql:
script:
- vendor/bin/phpunit -c vendor/coreshop/core-shop/tests/config/phpunit.xml --bootstrap vendor/coreshop/core-shop/tests/bootstrap.php vendor/coreshop/core-shop/tests/AllTests
# We test PHP7.1 with MySQL, but we allow it to fail
test:php7.1:mysql:
image: php:7.1
script:
- vendor/bin/phpunit -c vendor/coreshop/core-shop/tests/config/phpunit.xml --bootstrap vendor/coreshop/core-shop/tests/bootstrap.php vendor/coreshop/core-shop/tests/AllTests