.travis.yml 2.6 KB

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