From 9989d8b3f39f6e03c58f1e903d3b1965c786b285 Mon Sep 17 00:00:00 2001 From: Sanket322 Date: Thu, 22 Aug 2024 16:11:38 +0530 Subject: [PATCH] fix: post_install through install.sh --- .github/helper/install.sh | 3 +++ .github/workflows/post_install.yml | 40 +++++++++++++++--------------- india_compliance/install.py | 6 ++--- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 83bab4e90..41ae492f6 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -59,6 +59,9 @@ sed -i 's/socketio:/# socketio:/g' Procfile sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile bench get-app erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps + +bench --site test_site restore ${GITHUB_WORKSPACE}/20240822_151612-patch_test_localhost-database.sql.gz + bench get-app india_compliance "${GITHUB_WORKSPACE}" bench setup requirements --dev diff --git a/.github/workflows/post_install.yml b/.github/workflows/post_install.yml index 2bea0bad1..e2f18d282 100644 --- a/.github/workflows/post_install.yml +++ b/.github/workflows/post_install.yml @@ -95,23 +95,23 @@ jobs: env: BRANCH_TO_CLONE: ${{ github.base_ref }} - - name: Run Patch Tests - run: | - cd ~/frappe-bench/ - bench remove-app india_compliance --force - jq 'del(.install_apps)' ~/frappe-bench/sites/test_site/site_config.json > tmp.json - mv tmp.json ~/frappe-bench/sites/test_site/site_config.json - - bench --site test_site restore ${GITHUB_WORKSPACE}/20240822_151612-patch_test_localhost-database.sql.gz - - echo "Updating to latest version" - git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" - git -C "apps/erpnext" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" - git -C "apps/india_compliance" checkout -q -f "$GITHUB_SHA" - - pgrep honcho | xargs kill - rm -rf ~/frappe-bench/env - bench -v setup env - bench pip install -e ./apps/erpnext - bench pip install -e ./apps/india_compliance - bench start &>> ~/frappe-bench/bench_start.log & \ No newline at end of file + # - name: Run Patch Tests + # run: | + # cd ~/frappe-bench/ + # bench remove-app india_compliance --force + # jq 'del(.install_apps)' ~/frappe-bench/sites/test_site/site_config.json > tmp.json + # mv tmp.json ~/frappe-bench/sites/test_site/site_config.json + + # bench --site test_site restore ${GITHUB_WORKSPACE}/20240822_151612-patch_test_localhost-database.sql.gz + + # echo "Updating to latest version" + # git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" + # git -C "apps/erpnext" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" + # git -C "apps/india_compliance" checkout -q -f "$GITHUB_SHA" + + # pgrep honcho | xargs kill + # rm -rf ~/frappe-bench/env + # bench -v setup env + # bench pip install -e ./apps/erpnext + # bench pip install -e ./apps/india_compliance + # bench start &>> ~/frappe-bench/bench_start.log & \ No newline at end of file diff --git a/india_compliance/install.py b/india_compliance/install.py index a66164386..b37c74b5d 100644 --- a/india_compliance/install.py +++ b/india_compliance/install.py @@ -56,7 +56,7 @@ def after_install(): print("Setting up Income Tax...") setup_income_tax() - print("Setting up GST...") + # print("Setting up GST...") setup_gst() disable_ic_account_page() @@ -78,8 +78,8 @@ def after_install(): def run_post_install_patches(): - if not frappe.db.exists("Company", {"country": "India"}): - return + # if not frappe.db.exists("Company", {"country": "India"}): + # return frappe.flags.in_patch = True