language: php services: - docker - postgres sudo: required php: - 7.0 - 7.1 env: - BASE_URL="http://127.0.0.1:8080" install: - composer global require drush/drush:8 before_script: - docker pull statonlab/tripal2 - psql -c "create database test_db encoding 'utf-8';" -U postgres - psql -c "alter role postgres with password 'dbpass';" -U postgres - 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 # Run the php server - php -S 127.0.0.1:8080 & - 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, 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 uuid, jquery_update, views, webform script: # Link our repo to the modules directory - mv ../tripal sites/all/modules/tripal # Run a docker container with tripal 2 pre-installed - docker run -it -d --rm --name tripal2 -v "$(pwd)/tripal":/modules/tripal statonlab/tripal2 # 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 - 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 - composer update - cp tests/.travis.env tests/.env - ./vendor/bin/phpunit # Test Tripal v2 to v3 upgrade steps - docker exec -it tripal2 drush pm-disable tripal_core -y - docker exec -it tripal2 drush en -y tripal