From a6b3497cee134fa85175fbedd9e43b06d503c4ad Mon Sep 17 00:00:00 2001 From: Sanket322 Date: Sun, 21 Jul 2024 15:30:53 +0530 Subject: [PATCH] fix: installing india_compliance app in site --- .github/helper/install.sh | 2 +- .github/workflows/patch.yml | 70 ++++++++++++++++++++----------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 595341078..ec342e7b6 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -59,7 +59,7 @@ 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 get-app india_compliance "${GITHUB_WORKSPACE}" +bench get-app https://github.com/resilient-tech/india-compliance.git --branch "$BRANCH_TO_CLONE" --resolve-deps bench setup requirements --dev wait $wkpid diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index cfc82be32..17bf7b995 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -112,45 +112,49 @@ jobs: mv tmp.json ~/frappe-bench/sites/test_site/site_config.json wget https://erpnext.com/files/v13-erpnext.sql.gz - bench --site test_site --force restore ~/frappe-bench/v13-erpnext.sql.gz + bench --site test_site restore ~/frappe-bench/v13-erpnext.sql.gz + + echo "Listing all apps" + bench --site test_site list-apps git -C "apps/frappe" remote set-url upstream https://github.com/frappe/frappe.git git -C "apps/erpnext" remote set-url upstream https://github.com/frappe/erpnext.git git -C "apps/india_compliance" remote set-url upstream https://github.com/resilient-tech/india-compliance.git function update_to_version() { - version=$1 - - branch_name="version-$version-hotfix" - echo "Updating to v$version" - - echo "fetch branches" - git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name - git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name - git -C "apps/india_compliance" fetch --depth 1 upstream $branch_name:$branch_name - - echo "checout to branches" - git -C "apps/frappe" checkout -q -f $branch_name - git -C "apps/erpnext" checkout -q -f $branch_name - git -C "apps/india_compliance" checkout -q -f $branch_name - - echo "Resetup env and install apps" - pgrep honcho | xargs kill - rm -rf ~/frappe-bench/env - bench -v setup env - - echo "Install Erpnext" - bench pip install -e ./apps/erpnext - - echo "Install India Compliance" - bench pip install -e ./apps/india_compliance - - bench start &>> ~/frappe-bench/bench_start.log & - - echo "Listing apps" - bench --site test_site list-apps - - bench --site test_site migrate + version=$1 + + branch_name="version-$version-hotfix" + echo "Updating to v$version" + + echo "Fetching branches" + git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name + git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name + git -C "apps/india_compliance" fetch --depth 1 upstream $branch_name:$branch_name + + echo "Checking out branches" + git -C "apps/frappe" checkout -q -f $branch_name + git -C "apps/erpnext" checkout -q -f $branch_name + git -C "apps/india_compliance" checkout -q -f $branch_name + + bench --site test_site install-app india_compliance + + echo "Resetting environment and installing apps" + pgrep honcho | xargs kill || true + rm -rf ~/frappe-bench/env + bench -v setup env + + echo "Installing ERPNext" + bench pip install -e ./apps/erpnext + + echo "Installing India Compliance" + bench pip install -e ./apps/india_compliance + + echo "Starting bench" + bench start &>> ~/frappe-bench/bench_start.log & + + echo "Migrating site" + bench --site test_site migrate } update_to_version 14