forked from frappe/press
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
76 lines (61 loc) · 2.47 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
os: linux
dist: bionic
language: python
python: 3.10
addons:
hosts:
- test_site
mariadb: 10.3
git:
depth: 1
cache:
pip: true
directories:
- backbone/packer/images
- backbone/packer/builds
jobs:
include:
- name: Backbone Base Image Build
if: commit_message =~ travis:rebuild-image
before_script:
- sudo rm /usr/local/bin/packer
- python3 $TRAVIS_BUILD_DIR/backbone/setup.py
script:
- sudo -E su $USER -c '~/virtualenv/python3.7/bin/backbone hypervisor build'
- sudo -E su $USER -c '~/virtualenv/python3.7/bin/backbone hypervisor up'
- sudo -E su $USER -c '~/virtualenv/python3.7/bin/backbone hypervisor ssh -c "echo Hello, World"'
install:
- pip install -e $TRAVIS_BUILD_DIR
- mkdir ~/scratch && cd ~/scratch
- name: Press Tests
script:
- bench --site test_site run-tests --app press
- flake8 --ignore W191,E501,W503 apps/press/press
- black --check apps/press/press
- cd apps/press/dashboard && yarn run test
install:
- cd ~
- source ./.nvm/nvm.sh
- nvm install 14
- pip install frappe-bench flake8 git+https://github.com/adityahase/black
- pip install Click==8.0.2
- bench init frappe-bench --skip-assets --python $(which python)
- mkdir ~/frappe-bench/sites/test_site
- cp $TRAVIS_BUILD_DIR/.travis/mariadb.json ~/frappe-bench/sites/test_site/site_config.json
- mysql -u root -e "SET GLOBAL character_set_server = 'utf8mb4'";
- mysql -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
- mysql -u root -e "DROP DATABASE IF EXISTS test_frappe";
- mysql -u root -e "CREATE DATABASE test_frappe";
- mysql -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'";
- mysql -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'";
- mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'";
- mysql -u root -e "FLUSH PRIVILEGES";
- cd ./frappe-bench
- bench setup requirements --dev
- sed -i 's/watch:/# watch:/g' Procfile
- sed -i 's/schedule:/# schedule:/g' Procfile
- sed -i 's/socketio:/# socketio:/g' Procfile
- sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
- bench get-app press $TRAVIS_BUILD_DIR
- bench start &
- bench --site test_site reinstall --yes