|
@@ -2,37 +2,84 @@ language: php
|
|
|
|
|
|
services:
|
|
|
- docker
|
|
|
+ - postgres
|
|
|
|
|
|
sudo: required
|
|
|
|
|
|
+php:
|
|
|
+ - 5.6
|
|
|
+ - 7.0
|
|
|
+ - 7.1
|
|
|
+
|
|
|
+env:
|
|
|
+ - BASE_URL="http://localhost:8080"
|
|
|
+
|
|
|
+install:
|
|
|
+ - composer global require drush:8
|
|
|
+
|
|
|
before_script:
|
|
|
- - docker pull statonlab/drupal7
|
|
|
- docker pull statonlab/tripal2
|
|
|
- - docker pull statonlab/tripal3
|
|
|
+ - psql -c "create database test_db encoding 'utf-8';" -U postgres
|
|
|
+ - psql -c "alter role postgres with password 'dbpass';"
|
|
|
+ - cd ..
|
|
|
+
|
|
|
+ # Set additional environment variables
|
|
|
+ - export PATH="$HOME/.config/composer/vendor/bin:$PATH"
|
|
|
+ - export DRUPAL_ROOT="$(pwd)/drupal"
|
|
|
+
|
|
|
+ # Download and install Drupal
|
|
|
+ - drush dl drupal-7 -y
|
|
|
+ - mv drupal-7* drupal
|
|
|
+ - cd drupal
|
|
|
+ - drush si -y --db-url='pgsql://postgres:dbpass@localhost:5432/test_db'
|
|
|
+ --account-name='admin'
|
|
|
+ --account-pass='admin_pass'
|
|
|
+ --site-mail='admin@example.com'
|
|
|
+ --site-name='Tripal 3'
|
|
|
+
|
|
|
+ # Download Dependencies
|
|
|
+ - drush dl -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
|
|
|
+ ds, link, entity, libraries, redirect, token, tripal-7.x-3.0-rc2, uuid, jquery_update, views, webform
|
|
|
+
|
|
|
+ # Enable dependencies
|
|
|
+ - drush en -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
|
|
|
+ ds, link, entity, libraries, redirect, token, tripal-7.x-3.0-rc2, uuid, jquery_update, views, webform
|
|
|
+
|
|
|
+ # Run the drush server
|
|
|
+ - drush runserver localhost:8080 &
|
|
|
|
|
|
script:
|
|
|
- # Set branch name
|
|
|
- - export REPO=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_REPO_SLUG; else echo $TRAVIS_PULL_REQUEST_SLUG; fi)
|
|
|
- - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
|
|
|
- # Travis does a shallow clone and we need a full clone to test Tripal v2 to v3 upgrade
|
|
|
- - cd .. && rm -rf tripal && git clone https://github.com/$REPO.git tripal && cd tripal
|
|
|
- - git checkout $BRANCH
|
|
|
- # Test tripal 3 installation
|
|
|
- - docker run -it -d --rm --name tripal3 -v "$(pwd)":/modules/tripal statonlab/drupal7
|
|
|
- - sleep 15
|
|
|
- - docker exec -it tripal3 drush en -y tripal tripal_chado tripal_chado_views tripal_ds tripal_ws
|
|
|
+ # Link our repo to the modules directory
|
|
|
+ - ln -s ../tripal sites/all/modules/tripal
|
|
|
+
|
|
|
+ # Apply patches
|
|
|
+ - wget --no-check-certificate https://drupal.org/files/drupal.pgsql-bytea.27.patch
|
|
|
+ - patch -p1 < drupal.pgsql-bytea.27.patch
|
|
|
+ - cd sites/all/modules/views
|
|
|
+ - patch -p1 < ../tripal/tripal_chado_views/views-sql-compliant-three-tier-naming-1971160-30.patch
|
|
|
+ - cd ../tripal
|
|
|
+
|
|
|
+ # Install Tripal
|
|
|
+ - drush en -y tripal tripal_chado tripal_chado_views tripal_ds tripal_ws
|
|
|
+ - drush eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
|
|
|
+ - drush trp-run-jobs --username=admin
|
|
|
+
|
|
|
# Prepare Chado
|
|
|
- - docker exec -it tripal3 drush eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
|
|
|
- - docker exec -it tripal3 drush trp-run-jobs --username=admin
|
|
|
+ - drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
|
|
|
+ - drush trp-run-jobs --username=admin
|
|
|
+
|
|
|
# Prepare Drupal
|
|
|
- - docker exec -it tripal3 drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
|
|
|
- - docker exec -it tripal3 drush trp-run-jobs --username=admin
|
|
|
+ - drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
|
|
|
+ - drush trp-run-jobs --username=admin
|
|
|
+
|
|
|
# Run PHPUnit tests
|
|
|
- - docker exec -it tripal3 bash -c "cd /modules/tripal && composer install && DRUPAL_ROOT=/var/www/html ./vendor/bin/phpunit"
|
|
|
+ - composer install
|
|
|
+ - ./vendor/bin/phpunit
|
|
|
+
|
|
|
# Test Tripal v2 to v3 upgrade steps
|
|
|
- - docker run -it -d --rm --name tripal2 -v "$(pwd)":/modules/tripal statonlab/tripal2
|
|
|
- - sleep 15
|
|
|
- - docker exec -it tripal2 drush en -y tripal_core
|
|
|
- - docker exec -it tripal2 drush pm-disable tripal_core -y
|
|
|
- - git checkout $BRANCH
|
|
|
- - docker exec -it tripal2 drush en -y tripal
|
|
|
+# - docker run -it -d --rm --name tripal2 -v "$(pwd)":/modules/tripal statonlab/tripal2
|
|
|
+# - sleep 15
|
|
|
+# - docker exec -it tripal2 drush en -y tripal_core
|
|
|
+# - docker exec -it tripal2 drush pm-disable tripal_core -y
|
|
|
+# - git checkout $BRANCH
|
|
|
+# - docker exec -it tripal2 drush en -y tripal
|