forked from tripal/tripal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
37 lines (33 loc) · 1.78 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
language: php
services:
- docker
sudo: required
before_script:
- docker pull statonlab/drupal7
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
# 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
# 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
# Run PHPUnit tests
- docker exec -it tripal3 bash -c "cd /modules/tripal && composer install && DRUPAL_ROOT=/var/www/html ./vendor/bin/phpunit"
# Test Tripal v2 to v3 upgrade steps
- git checkout 7.x-2.x
- docker run -it -d --rm --name tripal2 -v "$(pwd)":/modules/tripal statonlab/drupal7
- 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