mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 00:06:36 +00:00
Merge pull request #820 from saurabh6790/validate-branch
fix: validate branch before update
This commit is contained in:
commit
afb5f532bd
10
bench/app.py
10
bench/app.py
@ -421,3 +421,13 @@ def get_apps_json(path):
|
|||||||
else:
|
else:
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
|
|
||||||
|
def validate_branch():
|
||||||
|
for app in ['frappe', 'erpnext']:
|
||||||
|
branch = get_current_branch(app)
|
||||||
|
|
||||||
|
if branch == "master":
|
||||||
|
print(''' master branch is renamed to version-11 and develop to version-12. Please switch to new branches to get future updates.
|
||||||
|
|
||||||
|
To switch to version 11, run the following commands: bench switch-to-branch version-11''')
|
||||||
|
sys.exit(1)
|
@ -1,7 +1,7 @@
|
|||||||
import click
|
import click
|
||||||
import sys, os
|
import sys, os
|
||||||
from bench.config.common_site_config import get_config, update_config
|
from bench.config.common_site_config import get_config, update_config
|
||||||
from bench.app import pull_all_apps, is_version_upgrade
|
from bench.app import pull_all_apps, is_version_upgrade, validate_branch
|
||||||
from bench.utils import (update_bench, validate_upgrade, pre_upgrade, post_upgrade, before_update,
|
from bench.utils import (update_bench, validate_upgrade, pre_upgrade, post_upgrade, before_update,
|
||||||
update_requirements, update_node_packages, backup_all_sites, patch_sites, build_assets,
|
update_requirements, update_node_packages, backup_all_sites, patch_sites, build_assets,
|
||||||
restart_supervisor_processes, restart_systemd_processes)
|
restart_supervisor_processes, restart_systemd_processes)
|
||||||
@ -48,8 +48,9 @@ def update(pull=False, patch=False, build=False, bench=False, auto=False, restar
|
|||||||
print('Release bench, cannot update')
|
print('Release bench, cannot update')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
version_upgrade = is_version_upgrade()
|
validate_branch()
|
||||||
|
|
||||||
|
version_upgrade = is_version_upgrade()
|
||||||
if version_upgrade[0]:
|
if version_upgrade[0]:
|
||||||
print()
|
print()
|
||||||
print()
|
print()
|
||||||
|
Loading…
Reference in New Issue
Block a user