-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
137 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd ~ || exit | ||
|
||
sudo apt update | ||
sudo apt remove mysql-server mysql-client | ||
sudo apt install libcups2-dev redis-server mariadb-client-10.6 | ||
|
||
pip install frappe-bench | ||
|
||
githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}} | ||
frappeuser=${FRAPPE_USER:-"frappe"} | ||
frappebranch=${FRAPPE_BRANCH:-$githubbranch} | ||
erpnextbranch=${ERPNEXT_BRANCH:-$githubbranch} | ||
|
||
git clone "https://github.com/${frappeuser}/frappe" --branch "${frappebranch}" --depth 1 | ||
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench | ||
|
||
mkdir ~/frappe-bench/sites/test_site | ||
cp -r "${GITHUB_WORKSPACE}/.github/helper/site_config.json" ~/frappe-bench/sites/test_site/ | ||
|
||
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'" | ||
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" | ||
|
||
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" | ||
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "CREATE DATABASE test_frappe" | ||
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" | ||
|
||
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "FLUSH PRIVILEGES" | ||
|
||
install_whktml() { | ||
wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz | ||
tar -xf /tmp/wkhtmltox.tar.xz -C /tmp | ||
sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf | ||
sudo chmod o+x /usr/local/bin/wkhtmltopdf | ||
} | ||
install_whktml & | ||
|
||
cd ~/frappe-bench || exit | ||
|
||
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 "https://github.com/${frappeuser}/erpnext" --branch "$erpnextbranch" --resolve-deps | ||
bench get-app payments "${GITHUB_WORKSPACE}" | ||
bench setup requirements --dev | ||
|
||
bench start &>> ~/frappe-bench/bench_start.log & | ||
CI=Yes bench build --app frappe & | ||
bench --site test_site reinstall --yes | ||
|
||
bench --verbose --site test_site install-app payments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters