From 9eca22bac406dfb1cc0b8f9bfb4fe89f4a0e2576 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 29 May 2020 11:15:34 +0530 Subject: [PATCH 01/11] chore: dont run travis for docs updates --- .travis.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aa4416c6..768e8c14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ dist: bionic sudo: true git: - depth: 1 + depth: 10 cache: - pip @@ -70,6 +70,16 @@ matrix: env: TEST=easy_install script: sudo python $TRAVIS_BUILD_DIR/install.py --user travis --run-travis --production --verbose +before_install: +- | + if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH" + fi + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '\.md$|^docs' || { + echo "Only docs were updated, stopping build process." + exit + } + install: - pip install urllib3 pyOpenSSL ndg-httpsclient pyasn1 From 45684ca685a38f46b97c5d7139336dccb138e538 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 29 May 2020 11:32:55 +0530 Subject: [PATCH 02/11] chore: depth 2 should suffice --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 768e8c14..19efc21b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ dist: bionic sudo: true git: - depth: 10 + depth: 2 cache: - pip From fdcf01d45ca5ec8e63b06b4ba224360080c0802e Mon Sep 17 00:00:00 2001 From: Nikunj Patel Date: Tue, 9 Jun 2020 12:25:26 +0200 Subject: [PATCH 03/11] For ubuntu >=18.04 use libssl1.1 to support upgrade of OS For ubuntu >=18.04 use libssl1.1 to support upgrade of OS since libssl1.0-dev is not supported by Ubuntu20.04 LTS. --- bench/playbooks/roles/common/tasks/ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/playbooks/roles/common/tasks/ubuntu.yml b/bench/playbooks/roles/common/tasks/ubuntu.yml index 527e42c2..cdc56065 100644 --- a/bench/playbooks/roles/common/tasks/ubuntu.yml +++ b/bench/playbooks/roles/common/tasks/ubuntu.yml @@ -33,9 +33,9 @@ - name: install pdf prerequisites for Ubuntu >= 18.04 apt: pkg: - - libssl1.0-dev + - libssl1.1 state: present force: yes when: ansible_distribution_version is version_compare('18.04', 'ge') -... \ No newline at end of file +... From 52ee67f298adb9939d9cee1266250968f35e8c0b Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 10 Jun 2020 14:11:33 +0530 Subject: [PATCH 04/11] fix: trailing slash deleting apps folder --- bench/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/app.py b/bench/app.py index 8b165b2b..d20e5a8c 100755 --- a/bench/app.py +++ b/bench/app.py @@ -116,7 +116,7 @@ def get_app(git_url, branch=None, bench_path='.', skip_assets=False, verbose=Fal sys.exit(1) # Gets repo name from URL - repo_name = git_url.rsplit('/', 1)[1].rsplit('.', 1)[0] + repo_name = git_url.rstrip('/').rsplit('/', 1)[1].rsplit('.', 1)[0] shallow_clone = '--depth 1' if check_git_for_shallow_clone() else '' branch = '--branch {branch}'.format(branch=branch) if branch else '' else: From 2fd86c9eb6220ea565daf7a5be5a8a1e22750c60 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 10 Jun 2020 19:27:58 +0530 Subject: [PATCH 05/11] fix: populate bench.log via bench.utils.log --- bench/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bench/utils.py b/bench/utils.py index 7914eecd..d94fc26b 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -70,9 +70,16 @@ def log(message, level=0): 2: color.red + 'ERROR', # fail 3: color.yellow + 'WARN' # warn/suggest } + loggers = { + 2: logger.error, + 3: logger.warning + } + start_line = (levels.get(level) + ': ') if level in levels else '' + level_logger = loggers.get(level, logger.info) end_line = '\033[0m' + level_logger(message) print(start_line + message + end_line) From 3336cff2b401f97bcf98dfed3d50601fb7c78ae3 Mon Sep 17 00:00:00 2001 From: Nikunj Patel Date: Wed, 24 Jun 2020 09:10:03 +0200 Subject: [PATCH 06/11] feat(playbooks): wkthmltox for Ubuntu 20 (#1019) * Updating file to support Ubuntu20.04 LTS * Update main.yml * Update bench/playbooks/roles/wkhtmltopdf/tasks/main.yml * Removed checksum from Ubuntu 20 Co-authored-by: gavin --- bench/playbooks/roles/wkhtmltopdf/tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bench/playbooks/roles/wkhtmltopdf/tasks/main.yml b/bench/playbooks/roles/wkhtmltopdf/tasks/main.yml index 1656ffd2..aea2f55f 100644 --- a/bench/playbooks/roles/wkhtmltopdf/tasks/main.yml +++ b/bench/playbooks/roles/wkhtmltopdf/tasks/main.yml @@ -20,6 +20,12 @@ force: yes when: ansible_os_family == 'Debian' +- name: download wkthmltox Ubuntu 20 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb + dest: /tmp/wkhtmltox.deb + when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '20' + - name: download wkthmltox Ubuntu 18 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb From 691687edbef00238166cd209717e66cd9fb74944 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Wed, 1 Jul 2020 18:54:41 +0530 Subject: [PATCH 07/11] fix: run backups every 6 hours, rather than every minute per 6 hours --- bench/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/utils.py b/bench/utils.py index d94fc26b..948d62ea 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -400,7 +400,7 @@ def setup_backups(bench_path='.'): if job_command not in str(system_crontab): job = system_crontab.new(command=job_command, comment="bench auto backups set for every 6 hours") - job.hour.every(6) + job.every(6).hours() system_crontab.write() From ce0a3de259d8f90749ff54ef1161b58ebc4f3d8f Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 3 Jul 2020 16:17:49 +0530 Subject: [PATCH 08/11] fix: dont show warning message in developer mode --- bench/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/cli.py b/bench/cli.py index bf0b5231..63369a1d 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -32,7 +32,7 @@ def cli(): change_dir() change_uid() - if is_dist_editable(bench.PROJECT_NAME) and len(sys.argv) > 1 and sys.argv[1] != "src": + if is_dist_editable(bench.PROJECT_NAME) and len(sys.argv) > 1 and sys.argv[1] != "src" and not get_config(".").get("developer_mode"): log("bench is installed in editable mode!\n\nThis is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`\n", level=3) if not is_bench_directory() and not cmd_requires_root() and len(sys.argv) > 1 and sys.argv[1] not in ("init", "find", "src"): From c76df683a149ae1fb2ae5cb9cb77f53a7f8a5157 Mon Sep 17 00:00:00 2001 From: Kenneth Sequeira <33246109+kennethsequeira@users.noreply.github.com> Date: Mon, 6 Jul 2020 11:18:36 +0530 Subject: [PATCH 09/11] chore: typo fix (#1029) Co-authored-by: gavin --- docs/easy_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/easy_install.md b/docs/easy_install.md index 7bf525d0..3c59f308 100644 --- a/docs/easy_install.md +++ b/docs/easy_install.md @@ -88,4 +88,4 @@ TLDR; Save the logs! 3. A lot of things can go wrong in setting up the environment due to prior settings, company protocols or even breaking changes in system packages and their dependencies. -4. Sharing your logfile in any issues opened related to this can help us find solutions to it faster and make the sript better! +4. Sharing your logfile in any issues opened related to this can help us find solutions to it faster and make the script better! From b237a0d2cf163e62e33bfb7bd964da5d711f3be3 Mon Sep 17 00:00:00 2001 From: gavin Date: Mon, 6 Jul 2020 11:23:16 +0530 Subject: [PATCH 10/11] Revert "chore: dont run travis for docs updates" --- .travis.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 19efc21b..aa4416c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ dist: bionic sudo: true git: - depth: 2 + depth: 1 cache: - pip @@ -70,16 +70,6 @@ matrix: env: TEST=easy_install script: sudo python $TRAVIS_BUILD_DIR/install.py --user travis --run-travis --production --verbose -before_install: -- | - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH" - fi - git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '\.md$|^docs' || { - echo "Only docs were updated, stopping build process." - exit - } - install: - pip install urllib3 pyOpenSSL ndg-httpsclient pyasn1 From e5c3b591f7c7da9ab2aad62e2996831371ec0890 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Mon, 6 Jul 2020 16:52:09 +0530 Subject: [PATCH 11/11] patch: fix old auto-backup cron jobs --- bench/patches/patches.txt | 1 + bench/patches/v5/fix_backup_cronjob.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 bench/patches/v5/fix_backup_cronjob.py diff --git a/bench/patches/patches.txt b/bench/patches/patches.txt index 7cb1a076..55a65019 100644 --- a/bench/patches/patches.txt +++ b/bench/patches/patches.txt @@ -5,3 +5,4 @@ bench.patches.v4.update_node bench.patches.v4.update_socketio bench.patches.v4.install_yarn #2 bench.patches.v5.fix_user_permissions +bench.patches.v5.fix_backup_cronjob diff --git a/bench/patches/v5/fix_backup_cronjob.py b/bench/patches/v5/fix_backup_cronjob.py new file mode 100644 index 00000000..15bbfcf3 --- /dev/null +++ b/bench/patches/v5/fix_backup_cronjob.py @@ -0,0 +1,15 @@ +from bench.config.common_site_config import get_config +from crontab import CronTab + + +def execute(bench_path): + """ + This patch fixes a cron job that would backup sites every minute per 6 hours + """ + + user = get_config(bench_path=bench_path).get('frappe_user') + user_crontab = CronTab(user=user) + + for job in user_crontab.find_comment("bench auto backups set for every 6 hours"): + job.every(6).hours() + user_crontab.write()