blob: 253ad701983edd0707cb4ada6b76e7e1010fe15d [file] [log] [blame]
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +05301#!/bin/bash
2
Mohammad Hasnain Mohsin Rajan46d54312021-03-15 11:17:19 +05303set -e
4
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +05305cd ~ || exit
6
7sudo apt-get install redis-server
8
Mohammad Hasnain Mohsin Rajan46d54312021-03-15 11:17:19 +05309sudo apt install nodejs
10
11sudo apt install npm
Mohammad Hasnain Mohsin Rajan0f60f082021-03-12 14:09:52 +053012
13pip install frappe-bench
14
15git clone https://github.com/frappe/frappe --branch "${GITHUB_BASE_REF}" --depth 1
16bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
17
18mkdir ~/frappe-bench/sites/test_site
19cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config.json" ~/frappe-bench/sites/test_site/
20
21mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL character_set_server = 'utf8mb4'"
22mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
23
24mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'"
25mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE DATABASE test_frappe"
26mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'"
27
28mysql --host 127.0.0.1 --port 3306 -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'"
29mysql --host 127.0.0.1 --port 3306 -u root -e "FLUSH PRIVILEGES"
30
31wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
32tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
33sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
34sudo chmod o+x /usr/local/bin/wkhtmltopdf
35sudo apt-get install libcups2-dev
36
37cd ~/frappe-bench || exit
38
39sed -i 's/watch:/# watch:/g' Procfile
40sed -i 's/schedule:/# schedule:/g' Procfile
41sed -i 's/socketio:/# socketio:/g' Procfile
42sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
43
44bench get-app erpnext "${GITHUB_WORKSPACE}"
45bench start &
46bench --site test_site reinstall --yes