.travis.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. language: php
  2. services:
  3. - docker
  4. - postgres
  5. sudo: required
  6. php:
  7. - 7.0
  8. - 7.1
  9. env:
  10. - BASE_URL="http://127.0.0.1:8080"
  11. install:
  12. - composer global require drush/drush:8
  13. before_script:
  14. - docker pull statonlab/tripal2
  15. - psql -c "create database test_db encoding 'utf-8';" -U postgres
  16. - psql -c "alter role postgres with password 'dbpass';" -U postgres
  17. - cd ..
  18. # Set additional environment variables
  19. - export PATH="$HOME/.config/composer/vendor/bin:$PATH"
  20. - export DRUPAL_ROOT="$(pwd)/drupal"
  21. # Download and install Drupal
  22. - drush dl drupal-7 -y
  23. - mv drupal-7* drupal
  24. - cd drupal
  25. # Run the php server
  26. - php -S 127.0.0.1:8080 &
  27. - drush si -y --db-url='pgsql://postgres:dbpass@localhost:5432/test_db'
  28. --account-name='admin'
  29. --account-pass='admin_pass'
  30. --site-mail='admin@example.com'
  31. --site-name='Tripal 3'
  32. # Download Dependencies
  33. - drush dl -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
  34. ds, link, entity, libraries, redirect, token, uuid, jquery_update, views, webform
  35. # Enable dependencies
  36. - drush en -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
  37. ds, link, entity, libraries, redirect, token uuid, jquery_update, views, webform
  38. script:
  39. # Link our repo to the modules directory
  40. - mv ../tripal sites/all/modules/tripal
  41. # Run a docker container with tripal 2 pre-installed
  42. - docker run -it -d --rm --name tripal2 -v "$(pwd)/tripal":/modules/tripal statonlab/tripal2
  43. # Apply patches
  44. - wget --no-check-certificate https://drupal.org/files/drupal.pgsql-bytea.27.patch
  45. - patch -p1 < drupal.pgsql-bytea.27.patch
  46. - cd sites/all/modules/views
  47. - patch -p1 < ../tripal/tripal_chado_views/views-sql-compliant-three-tier-naming-1971160-30.patch
  48. - cd ../tripal
  49. # Install Tripal
  50. - drush en -y tripal tripal_chado tripal_chado_views tripal_ds tripal_ws
  51. - drush eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
  52. - drush trp-run-jobs --username=admin
  53. # Prepare Chado
  54. - drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
  55. - drush trp-run-jobs --username=admin
  56. # Run PHPUnit tests
  57. - composer update
  58. - cp tests/.travis.env tests/.env
  59. - ./vendor/bin/phpunit
  60. # Test Tripal v2 to v3 upgrade steps
  61. - docker exec -it tripal2 drush pm-disable tripal_core -y
  62. - docker exec -it tripal2 drush en -y tripal