forked from mkalkbrenner/search_api_solr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
163 lines (152 loc) · 8.17 KB
/
.travis.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
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
language: php
dist: trusty
php:
- 7.1
- 7.3
env:
- SOLR_VERSION=8.2.0 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- SOLR_VERSION=8.2.0 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
- SOLR_VERSION=8.2.0 DRUPAL_BRANCH=8.7.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- SOLR_VERSION=8.2.0 DRUPAL_BRANCH=8.7.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
- SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
- SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.7.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.7.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
- SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.6.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
- SOLR_VERSION=6.6.6 DRUPAL_BRANCH=8.7.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- SOLR_VERSION=6.6.6 DRUPAL_BRANCH=8.7.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
git:
# The depth needs to be increased. The default of 50 leads to fatal: reference
# repository '/home/travis/.cache/composer/vcs/-home-travis-build-mkalkbrenner
# -search-api-solr/' is shallow.
depth: 10000
cache:
directories:
- $HOME/.composer/cache
- solr_downloads
services:
- mysql
before_install:
- phpenv config-rm xdebug.ini || true
- composer global require "hirak/prestissimo:^0.3"
- ls solr_downloads/
- wget -nc --continue -v --tries=3 --directory-prefix=solr_downloads "http://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz"
- tar -xzf solr_downloads/solr-${SOLR_VERSION}.tgz
- mysql -e 'CREATE DATABASE drupal;'
install:
- git tag 999.3.0
# Make sure we don't fail when checking out projects.
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "Host git.drupal.org\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
# Set sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Forward the errors to the syslog so we can print them
- echo "error_log=syslog" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Get the Drupal core.
- cd $TRAVIS_BUILD_DIR/..
- git clone --depth=1 --branch $DRUPAL_BRANCH https://git.drupal.org/project/drupal.git
- cd $TRAVIS_BUILD_DIR/../drupal
- composer install
- composer config repositories.search_api_solr vcs $TRAVIS_BUILD_DIR
- composer require drupal/search_api:1.x-dev drupal/search_api_autocomplete:1.x-dev drupal/search_api_solr:999.3.0 drupal/search_api_location:1.x-dev drupal/facets:1.x-dev drupal/geofield:1.x-dev drupal/composer_deploy drush/drush:$DRUSH_VERSION drupal/drush_language:1.x-dev
- |
if [ ${DRUPAL_BRANCH} != "8.8.x" ]; then
composer run-script drupal-phpunit-upgrade
fi
# Patch template.
#########################################
# to be removed once #2824932 is resolved
#- cd modules/contrib/search_api
#- curl https://www.drupal.org/files/issues/2018-12-20/3021717.patch | patch -p1
#- cd $TRAVIS_BUILD_DIR/../drupal
before_script:
- export SOLR_INDEX_WAIT=4
- export SYMFONY_DEPRECATIONS_HELPER=disabled
- export SIMPLETEST_DB=mysql://root:@localhost/drupal
- export SIMPLETEST_BASE_URL=http://localhost:8888
# Start the built-in php web server (mysql is already started) and suppress
# web server access logs output.
- php -S localhost:8888 >& /dev/null &
# Install the site.
- ./vendor/bin/drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes
- ./vendor/bin/drush en --yes drush_language
- ./vendor/bin/drush language-add ar
- ./vendor/bin/drush language-add bg
- ./vendor/bin/drush language-add ca
- ./vendor/bin/drush language-add cs
- ./vendor/bin/drush language-add da
- ./vendor/bin/drush language-add de
- ./vendor/bin/drush language-add el
- ./vendor/bin/drush language-add es
- ./vendor/bin/drush language-add et
- ./vendor/bin/drush language-add fa
- ./vendor/bin/drush language-add fi
- ./vendor/bin/drush language-add fr
- ./vendor/bin/drush language-add hi
- ./vendor/bin/drush language-add hr
- ./vendor/bin/drush language-add id
- ./vendor/bin/drush language-add it
- ./vendor/bin/drush language-add ja
- ./vendor/bin/drush language-add lv
- ./vendor/bin/drush language-add nb
- ./vendor/bin/drush language-add nl
- ./vendor/bin/drush language-add nn
- ./vendor/bin/drush language-add no
- ./vendor/bin/drush language-add pl
- ./vendor/bin/drush language-add pt
- ./vendor/bin/drush language-add ro
- ./vendor/bin/drush language-add ru
- ./vendor/bin/drush language-add sk
- ./vendor/bin/drush language-add sr
- ./vendor/bin/drush language-add sv
- ./vendor/bin/drush language-add th
- ./vendor/bin/drush language-add tr
- ./vendor/bin/drush language-add uk
- ./vendor/bin/drush language-add zh-hans
- ./vendor/bin/drush language-add zh-hant
# Let dev versions fulfill module version dependencies.
- ./vendor/bin/drush en composer_deploy --yes
# Generate a multilingual Solr configuration. Therefore we have to install the
# test modules before the tests.
- cp -a core/modules/system/tests/modules/entity_test core/modules/system/entity_test
- cp -a modules/contrib/search_api/tests/search_api_test_example_content modules/contrib/search_api/search_api_test_example_content
- cp -a modules/contrib/search_api_solr/tests/modules/search_api_solr_test modules/contrib/search_api_solr/search_api_solr_test
- ./vendor/bin/drush en --yes search_api_solr_test
- ./vendor/bin/drush solr-gsc solr_search_server conf.zip $SOLR_VERSION
- rm -rf core/modules/system/entity_test modules/contrib/search_api/search_api_test_example_content modules/contrib/search_api_solr/search_api_solr_test
- mkdir $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8
- mkdir $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8/conf
- unzip -o conf.zip -d $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8/conf
- echo "solr.install.dir=$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}" >> $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8/conf/solrcore.properties
- ls -lh $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8/conf
- |
if [ ${SOLR_CLOUD} == "true" ]; then
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr start -e cloud -noprompt || travis_terminate 1;
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr delete -c gettingstarted || travis_terminate 1;
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr create -c techproducts -s 2 -rf 2 -d $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/configsets/sample_techproducts_configs/conf -n sample_techproducts_configs || travis_terminate 1;
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/post -c techproducts $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/example/exampledocs/*.xml || travis_terminate 1;
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr create -c d8 -s 2 -rf 2 -d $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8/conf -n d8 || travis_terminate 1;
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr create -c checkpoints -s 1 -rf 2 || travis_terminate 1;
else
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr start -e techproducts || travis_terminate 1;
$TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/bin/solr create -c d8 -d $TRAVIS_BUILD_DIR/solr-${SOLR_VERSION}/server/solr/d8/conf || travis_terminate 1;
fi
script:
# Run the tests within the drupal directory.
- cd $TRAVIS_BUILD_DIR/../drupal
- |
if [ ${SOLR_CLOUD} == "true" ]; then
vendor/bin/phpunit -c core --group search_api_solr --verbose --debug --exclude-group solr_no_cloud modules/contrib/search_api_solr || travis_terminate 1;
else
vendor/bin/phpunit -c core --group search_api_solr --verbose --debug --exclude-group solr_cloud modules/contrib/search_api_solr || travis_terminate 1;
fi
matrix:
exclude:
- php: 7.1
env: SOLR_VERSION=8.2.0 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- php: 7.1
env: SOLR_VERSION=8.2.0 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false
- php: 7.1
env: SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=true
- php: 7.1
env: SOLR_VERSION=7.7.2 DRUPAL_BRANCH=8.8.x DRUSH_VERSION=~9.7.0 SOLR_CLOUD=false