From 46b78f4a53485849fffa3354983f22f890fdc900 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Fri, 21 Jun 2019 11:50:30 +0530 Subject: [PATCH 1/5] fix: Remove the infamous print style --- bench/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bench/app.py b/bench/app.py index 8b6c25e2..72f91020 100755 --- a/bench/app.py +++ b/bench/app.py @@ -1,3 +1,4 @@ +from __future__ import print_function import os from .utils import (exec_cmd, get_frappe, check_git_for_shallow_clone, build_assets, restart_supervisor_processes, get_cmd_output, run_frappe_cmd, CommandFailedError, From bdda0419ea165e41a279a8858b0568f1b5622990 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Mon, 1 Jul 2019 22:26:58 +0530 Subject: [PATCH 2/5] fix: Allow skipping assets --- bench/commands/make.py | 5 +++-- bench/utils.py | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bench/commands/make.py b/bench/commands/make.py index e30f23d5..b3ca8341 100755 --- a/bench/commands/make.py +++ b/bench/commands/make.py @@ -13,10 +13,11 @@ import click @click.option('--no-backups',is_flag=True, help="Run migrations for all sites in the bench") @click.option('--no-auto-update',is_flag=True, help="Build JS and CSS artifacts for the bench") @click.option('--skip-redis-config-generation', is_flag=True, help="Skip redis config generation if already specifying the common-site-config file") +@click.option('--skip-assets',is_flag=True, default=False, help="Do not build assets") @click.option('--verbose',is_flag=True, help="Verbose output during install") def init(path, apps_path, frappe_path, frappe_branch, no_procfile, no_backups, no_auto_update, clone_from, verbose, skip_redis_config_generation, clone_without_update, - ignore_exist = False, + ignore_exist = False, skip_assets=False, python = 'python3'): ''' Create a New Bench Instance. @@ -26,7 +27,7 @@ def init(path, apps_path, frappe_path, frappe_branch, no_procfile, no_backups, no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch, verbose=verbose, clone_from=clone_from, skip_redis_config_generation=skip_redis_config_generation, clone_without_update=clone_without_update, - ignore_exist = ignore_exist, + ignore_exist = ignore_exist, skip_assets=skip_assets, python = python) click.echo('Bench {} initialized'.format(path)) diff --git a/bench/utils.py b/bench/utils.py index cee84833..496410d3 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -37,7 +37,7 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False, no_auto_update=False, frappe_path=None, frappe_branch=None, wheel_cache_dir=None, verbose=False, clone_from=None, skip_redis_config_generation=False, clone_without_update=False, - ignore_exist = False, + ignore_exist = False, skip_assets=False, python = 'python3'): # Let's change when we're ready. - from .app import get_app, install_apps_from_path from .config.common_site_config import make_config @@ -80,10 +80,12 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False, bench.set_frappe_version(bench_path=path) if bench.FRAPPE_VERSION > 5: - update_node_packages(bench_path=path) + if not skip_assets: + update_node_packages(bench_path=path) set_all_patches_executed(bench_path=path) - build_assets(bench_path=path) + if not skip_assets: + build_assets(bench_path=path) if not skip_redis_config_generation: redis.generate_config(path) From 46566cd9ac0bfe0a828b9a0fd6e89f37bfdebafe Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 23 Jul 2019 19:50:07 +0530 Subject: [PATCH 3/5] fix(ansible): Make everything verbose --- bench/utils.py | 2 +- playbooks/install.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/bench/utils.py b/bench/utils.py index 496410d3..c0fd88df 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -814,7 +814,7 @@ def run_playbook(playbook_name, extra_vars=None, tag=None): if not find_executable('ansible'): print("Ansible is needed to run this command, please install it using 'pip install ansible'") sys.exit(1) - args = ['ansible-playbook', '-c', 'local', playbook_name] + args = ['ansible-playbook', '-c', 'local', playbook_name, '-vvvv'] if extra_vars: args.extend(['-e', json.dumps(extra_vars)]) diff --git a/playbooks/install.py b/playbooks/install.py index 670ccbcc..ecabd422 100644 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -310,14 +310,11 @@ def get_extra_vars_json(extra_args): return ('@' + json_path) def run_playbook(playbook_name, sudo=False, extra_vars=None): - args = ['ansible-playbook', '-c', 'local', playbook_name] + args = ['ansible-playbook', '-c', 'local', playbook_name , '-vvvv'] if extra_vars: args.extend(['-e', get_extra_vars_json(extra_vars)]) - if extra_vars.get('verbosity'): - args.append('-vvvv') - if sudo: user = extra_vars.get('user') or getpass.getuser() args.extend(['--become', '--become-user={0}'.format(user)]) From 1c8b4c032549af0822e2b027c32363491c71f2f0 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 23 Jul 2019 19:54:34 +0530 Subject: [PATCH 4/5] fix(travis): Use Ubuntu 16.04 --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3221fd8..b4b6de7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,10 @@ language: python -dist: trusty +dist: xenial python: - "2.7" install: - - sudo rm /etc/apt/sources.list.d/mongodb*.list - - sudo rm /etc/apt/sources.list.d/docker.list - sudo pip install urllib3 pyOpenSSL ndg-httpsclient pyasn1 - sudo apt-get purge -y mysql-common mysql-server mysql-client - sudo apt-get install --only-upgrade -y git From f57635eebf45bdda85c5d5c4fa2efc15dcfc7ee1 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Tue, 23 Jul 2019 20:00:05 +0530 Subject: [PATCH 5/5] fix(travis): Make install script verbose --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b4b6de7f..9df3b6d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: - cp -r $TRAVIS_BUILD_DIR/* ~/.bench - cp -r $TRAVIS_BUILD_DIR/* /tmp/.bench - - sudo python $TRAVIS_BUILD_DIR/playbooks/install.py --user travis --run-travis --production + - sudo python $TRAVIS_BUILD_DIR/playbooks/install.py --user travis --run-travis --production --verbose # - sudo bash $TRAVIS_BUILD_DIR/install_scripts/setup_frappe.sh --skip-install-bench --mysql-root-password travis # - cd ~ && sudo python bench-repo/installer/install.py --only-dependencies