2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 00:37:51 +00:00

Add switch-to-v5 #142

This commit is contained in:
Pratik Vyas 2015-08-22 16:56:29 -07:00
parent 27d64b6ea6
commit 783a6e7d02
2 changed files with 14 additions and 1 deletions

View File

@ -179,6 +179,9 @@ def switch_to_develop(apps=None, bench='.', upgrade=False):
def switch_to_v4(apps=None, bench='.', upgrade=False): def switch_to_v4(apps=None, bench='.', upgrade=False):
switch_branch('v4.x.x', apps=apps, bench=bench, upgrade=upgrade) switch_branch('v4.x.x', apps=apps, bench=bench, upgrade=upgrade)
def switch_to_v5(apps=None, bench='.', upgrade=False):
switch_branch('v5.x.x', apps=apps, bench=bench, upgrade=upgrade)
def get_version_from_string(contents): def get_version_from_string(contents):
match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % 'version', match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % 'version',
contents) contents)

View File

@ -17,7 +17,7 @@ from .utils import (build_assets, patch_sites, exec_cmd, update_bench, get_env_c
pre_upgrade, validate_upgrade, PatchError, download_translations_p, setup_socketio) pre_upgrade, validate_upgrade, PatchError, download_translations_p, setup_socketio)
from .app import get_app as _get_app from .app import get_app as _get_app
from .app import new_app as _new_app from .app import new_app as _new_app
from .app import pull_all_apps, get_apps, get_current_frappe_version, is_version_upgrade, switch_to_v4, switch_to_master, switch_to_develop from .app import pull_all_apps, get_apps, get_current_frappe_version, is_version_upgrade, switch_to_v4, switch_to_v5, switch_to_master, switch_to_develop
from .config import generate_nginx_config, generate_supervisor_config, generate_redis_cache_config, generate_redis_async_broker_config from .config import generate_nginx_config, generate_supervisor_config, generate_redis_cache_config, generate_redis_async_broker_config
from .production_setup import setup_production as _setup_production from .production_setup import setup_production as _setup_production
from .migrate_to_v5 import migrate_to_v5 from .migrate_to_v5 import migrate_to_v5
@ -339,6 +339,15 @@ def _switch_to_v4(upgrade=False):
print 'Switched to v4' print 'Switched to v4'
print 'Please run `bench update --patch` to be safe from any differences in database schema' print 'Please run `bench update --patch` to be safe from any differences in database schema'
@click.command('switch-to-v5')
@click.option('--upgrade',is_flag=True)
def _switch_to_v5(upgrade=False):
"Switch frappe and erpnext to v4 branch"
switch_to_v5(upgrade=upgrade)
print
print 'Switched to v5'
print 'Please run `bench update --patch` to be safe from any differences in database schema'
@click.command('set-nginx-port') @click.command('set-nginx-port')
@click.argument('site') @click.argument('site')
@click.argument('port', type=int) @click.argument('port', type=int)
@ -611,6 +620,7 @@ bench.add_command(migrate_3to4)
bench.add_command(_switch_to_master) bench.add_command(_switch_to_master)
bench.add_command(_switch_to_develop) bench.add_command(_switch_to_develop)
bench.add_command(_switch_to_v4) bench.add_command(_switch_to_v4)
bench.add_command(_switch_to_v5)
bench.add_command(shell) bench.add_command(shell)
bench.add_command(_backup_all_sites) bench.add_command(_backup_all_sites)
bench.add_command(_backup_site) bench.add_command(_backup_site)