Skip to content

Commit

Permalink
Merge pull request #207 from RitvikSardana/develop-ritvik-www-fix
Browse files Browse the repository at this point in the history
fix: change copy file in www
  • Loading branch information
RitvikSardana authored Feb 23, 2024
2 parents 6fd9538 + 2a28509 commit d055a30
Show file tree
Hide file tree
Showing 33 changed files with 860 additions and 4,422 deletions.
51 changes: 51 additions & 0 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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

git clone https://github.com/frappe/frappe --branch "$BRANCH_TO_CLONE" --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/frappe/erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps
bench get-app education "${GITHUB_WORKSPACE}"
bench setup requirements --dev
bench build

bench start &>> ~/frappe-bench/bench_start.log &
bench --site test_site reinstall --yes

bench --verbose --site test_site install-app education
16 changes: 16 additions & 0 deletions .github/helper/site_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"db_host": "127.0.0.1",
"db_port": 3306,
"db_name": "test_frappe",
"db_password": "test_frappe",
"auto_email_id": "[email protected]",
"mail_server": "smtp.example.com",
"mail_login": "[email protected]",
"mail_password": "test",
"admin_password": "admin",
"root_login": "root",
"root_password": "root",
"host_name": "http://test_site:8000",
"install_apps": ["erpnext"],
"throttle_user_limit": 100
}
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
pull_request:
paths-ignore:
- "**.css"
- "**.js"
- "**.md"
- "**.html"
- "**.csv"
schedule:
# Run everday at midnight UTC / 5:30 IST
- cron: "0 0 * * *"
env:
EDUCATION_BRANCH: ${{ github.base_ref || github.ref_name }}

concurrency:
group: develop-${{ github.event.number }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
NODE_ENV: "production"

strategy:
fail-fast: false

matrix:
container: [1, 2]

name: Python Unit Tests

services:
mysql:
image: mariadb:10.6
env:
MARIADB_ROOT_PASSWORD: 'root'
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3

steps:
- name: Clone
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Check for valid Python & Merge Conflicts
run: |
python -m compileall -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 18
check-latest: true

- name: Add to Hosts
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install
run: |
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
BRANCH_TO_CLONE: ${{ env.EDUCATION_BRANCH }}

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
tags
education/docs/current
dist/
__pycache__/
__pycache__/
node_modules
education/public/frontend
education/www/education.html
1 change: 1 addition & 0 deletions education/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

website_route_rules = [
{"from_route": "/admissions", "to_route": "Student Admission"},
{"from_route": "/education/<path:app_path>", "to_route": "education"},
]

treeviews = ["Assessment Group"]
Expand Down
1 change: 0 additions & 1 deletion education/public/frontend/assets/Attendance.e3077277.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/Fees.34bdecc8.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/FontColor.283f7e45.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/Grades.44a9a37e.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/Home.6059a353.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/InsertImage.2d7b0b05.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/InsertLink.88a21340.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/InsertVideo.df1b339b.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/Leaves.08109b90.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/Profile.80ee4793.js

This file was deleted.

1 change: 0 additions & 1 deletion education/public/frontend/assets/Schedule.012257c2.css

This file was deleted.

Loading

0 comments on commit d055a30

Please sign in to comment.