Pratik Vyas | cc9bc95 | 2014-02-06 14:59:05 +0530 | [diff] [blame] | 1 | language: python |
shreyas | 60e9f84 | 2016-07-29 19:39:49 +0530 | [diff] [blame] | 2 | dist: trusty |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 3 | |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 4 | python: |
| 5 | - "2.7" |
| 6 | |
| 7 | services: |
| 8 | - mysql |
| 9 | |
| 10 | install: |
Rushabh Mehta | 2653825 | 2017-07-28 11:37:45 +0530 | [diff] [blame] | 11 | - pip install flake8==3.3.0 |
| 12 | - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 13 | - sudo rm /etc/apt/sources.list.d/docker.list |
shreyas | 60e9f84 | 2016-07-29 19:39:49 +0530 | [diff] [blame] | 14 | - sudo apt-get purge -y mysql-common mysql-server mysql-client |
Makarand Bauskar | 0b8f920 | 2017-06-01 18:56:39 +0530 | [diff] [blame] | 15 | - nvm install v7.10.0 |
shreyas | 60e9f84 | 2016-07-29 19:39:49 +0530 | [diff] [blame] | 16 | - wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py |
| 17 | - sudo python install.py --develop --user travis --without-bench-setup |
| 18 | - sudo pip install -e ~/bench |
| 19 | |
Pratik Vyas | 2a47eeb | 2015-01-01 15:48:04 +0530 | [diff] [blame] | 20 | - rm $TRAVIS_BUILD_DIR/.git/shallow |
Anand Doshi | 6677fd5 | 2016-04-07 18:19:56 +0530 | [diff] [blame] | 21 | - bash $TRAVIS_BUILD_DIR/travis/bench_init.sh |
Pratik Vyas | 2a47eeb | 2015-01-01 15:48:04 +0530 | [diff] [blame] | 22 | - cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/ |
Pratik Vyas | 8668081 | 2014-10-12 19:35:46 +0530 | [diff] [blame] | 23 | |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 24 | before_script: |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 25 | - mysql -u root -ptravis -e 'create database test_frappe' |
| 26 | - echo "USE mysql;\nCREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe';\nFLUSH PRIVILEGES;\n" | mysql -u root -ptravis |
| 27 | - echo "USE mysql;\nGRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost';\n" | mysql -u root -ptravis |
| 28 | |
Pratik Vyas | 2a47eeb | 2015-01-01 15:48:04 +0530 | [diff] [blame] | 29 | - cd ~/frappe-bench |
| 30 | - bench get-app erpnext $TRAVIS_BUILD_DIR |
Pratik Vyas | 52d3697 | 2015-03-31 13:11:32 +0530 | [diff] [blame] | 31 | - bench use test_site |
Rushabh Mehta | cc88790 | 2016-07-24 22:45:09 +0530 | [diff] [blame] | 32 | - bench reinstall --yes |
Anand Doshi | d726ce5 | 2015-08-17 15:13:58 +0530 | [diff] [blame] | 33 | - bench build |
Rushabh Mehta | 4a7b4ef | 2017-07-10 23:00:01 +0530 | [diff] [blame] | 34 | - bench scheduler disable |
Anand Doshi | d726ce5 | 2015-08-17 15:13:58 +0530 | [diff] [blame] | 35 | - bench start & |
Anand Doshi | 1b6c3f1 | 2015-05-28 21:46:40 -0400 | [diff] [blame] | 36 | - sleep 10 |
Pratik Vyas | f437e86 | 2013-12-24 12:17:59 +0530 | [diff] [blame] | 37 | |
Vishal Dhayagude | 52ac483 | 2017-09-13 15:18:41 +0530 | [diff] [blame] | 38 | jobs: |
| 39 | include: |
| 40 | - stage: test |
| 41 | script: |
| 42 | - set -e |
| 43 | - bench run-tests |
Vishal Dhayagude | c4c2c56 | 2017-09-21 12:07:56 +0530 | [diff] [blame] | 44 | env: Server Side Test |
Vishal Dhayagude | 52ac483 | 2017-09-13 15:18:41 +0530 | [diff] [blame] | 45 | - # stage |
| 46 | script: |
Saurabh | a8823ea | 2017-11-09 17:07:43 +0530 | [diff] [blame] | 47 | - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz |
| 48 | - bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis |
| 49 | - bench migrate |
| 50 | env: Patch Testing |