From d573ba8769b6ac73cec7f1427f3747a3162027e6 Mon Sep 17 00:00:00 2001 From: vrslev Date: Sat, 25 Dec 2021 07:07:48 +0000 Subject: [PATCH 1/9] chore(deps): Update pre-commit hooks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69099c85..134a0e1a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: types: [shell] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.8.0.2 + rev: v0.8.0.3 hooks: - id: shellcheck args: [-x] From a46a97dc812477f4a7cb1813a447bcb319116c9f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 09:59:56 +0300 Subject: [PATCH 2/9] chore(deps): Update pre-commit hooks (#623) Co-authored-by: vrslev --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 134a0e1a..7d4a790f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - repo: https://github.com/asottile/pyupgrade - rev: v2.29.1 + rev: v2.30.0 hooks: - id: pyupgrade args: [--py37-plus] From 52f91b318c457e0deedfc06e22c6046579fcc13a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Jan 2022 18:45:56 +0300 Subject: [PATCH 3/9] chore(deps): Update pre-commit hooks (#625) Co-authored-by: vrslev --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d4a790f..0bf9f03c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - repo: https://github.com/asottile/pyupgrade - rev: v2.30.0 + rev: v2.31.0 hooks: - id: pyupgrade args: [--py37-plus] From 42bfd485f881e70918707a5ffa99778873baca13 Mon Sep 17 00:00:00 2001 From: Robproject <74115869+Robproject@users.noreply.github.com> Date: Fri, 7 Jan 2022 00:35:04 -0800 Subject: [PATCH 4/9] Change erpnext-python volumes description (#628) --- docs/single-bench.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/single-bench.md b/docs/single-bench.md index 44949691..b1487516 100644 --- a/docs/single-bench.md +++ b/docs/single-bench.md @@ -99,7 +99,7 @@ The docker-compose file contains following services: - erpnext-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port. - volume: assets-vol and sites-vol - erpnext-python: main application code - - volume: sites-vol and sites-vol + - volume: assets-vol and sites-vol - frappe-socketio: enables realtime communication to the user interface through websockets - volume: sites-vol - erpnext-worker-default: background runner From 18a16372b2b928786587308d01459cd10e9fe7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Bottini?= Date: Wed, 12 Jan 2022 08:11:50 +0100 Subject: [PATCH 5/9] Update references to $ERPNEXT_VERSION (#631) * Update references to $ERPNEXT_VERSION Documentation is making references to an unexisting $VERSION variable. I'm updating it to $ERPNEXT_VERSION. * Update site-operations.md to use $FRAPPE_VERSION Fix references to $ERPNEXT_VERSION when using frappe/frappe-worker so now it uses $FRAPPE_VERSION --- docs/site-operations.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/site-operations.md b/docs/site-operations.md index bf7ac0c3..a8b6e220 100644 --- a/docs/site-operations.md +++ b/docs/site-operations.md @@ -28,7 +28,7 @@ docker run \ -e "INSTALL_APPS=erpnext" \ -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ - frappe/erpnext-worker:$VERSION new + frappe/erpnext-worker:$ERPNEXT_VERSION new ``` #### PostgreSQL Site @@ -46,7 +46,7 @@ docker run \ -e "ADMIN_PASSWORD=$ADMIN_PASSWORD" \ -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ - frappe/erpnext-worker:$VERSION new + frappe/erpnext-worker:$ERPNEXT_VERSION new ``` Environment Variables needed: @@ -96,7 +96,7 @@ docker run \ -e "WITH_FILES=1" \ -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ - frappe/erpnext-worker:$VERSION backup + frappe/erpnext-worker:$ERPNEXT_VERSION backup ``` The backup will be available in the `sites-vol` volume. @@ -123,7 +123,7 @@ Environment Variables -e "BUCKET_DIR=frappe-bench" \ -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ - frappe/frappe-worker:$VERSION push-backup + frappe/frappe-worker:$FRAPPE_VERSION push-backup ``` Note: @@ -157,7 +157,7 @@ docker run \ -v _sites-vol:/home/frappe/frappe-bench/sites \ -v ./backups:/home/frappe/backups \ --network _default \ - frappe/frappe-worker:$VERSION restore-backup + frappe/frappe-worker:$FRAPPE_VERSION restore-backup ``` Note: @@ -213,7 +213,7 @@ To execute commands using bench helper. -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ --user frappe \ - frappe/frappe-worker:$VERSION bench --help + frappe/frappe-worker:$FRAPPE_VERSION bench --help ``` Example command to clear cache @@ -223,7 +223,7 @@ Example command to clear cache -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ --user frappe \ - frappe/frappe-worker:$VERSION bench --site erp.mysite.com clear-cache + frappe/frappe-worker:$FRAPPE_VERSION bench --site erp.mysite.com clear-cache ``` Notes: @@ -243,7 +243,7 @@ docker run \ -e "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \ -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ - frappe/erpnext-worker:$VERSION drop + frappe/erpnext-worker:$ERPNEXT_VERSION drop ``` #### PostgreSQL Site @@ -256,7 +256,7 @@ docker run \ -e "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" \ -v _sites-vol:/home/frappe/frappe-bench/sites \ --network _default \ - frappe/erpnext-worker:$VERSION drop + frappe/erpnext-worker:$ERPNEXT_VERSION drop ``` Environment Variables needed: From 7404bcadeea514a7fa550f613e0b43ac1962a4cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 12:13:43 +0300 Subject: [PATCH 6/9] chore(deps): Update pre-commit hooks (#644) Co-authored-by: vrslev --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0bf9f03c..0ea58a5b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: args: [--py37-plus] - repo: https://github.com/psf/black - rev: 21.12b0 + rev: 22.1.0 hooks: - id: black From 55a4dc9269ca20be8b94c4ebc0c6a51d49e993f5 Mon Sep 17 00:00:00 2001 From: Vaibhav Chopra <53619134+sudo-vaibhav@users.noreply.github.com> Date: Wed, 2 Feb 2022 17:25:19 +0530 Subject: [PATCH 7/9] Update settings.json (#648) removes a squiggly line whenever doing imports like ``` from frappe.model.document import Document ``` --- development/vscode-example/settings.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/development/vscode-example/settings.json b/development/vscode-example/settings.json index e5d9441c..7df2d897 100644 --- a/development/vscode-example/settings.json +++ b/development/vscode-example/settings.json @@ -1,3 +1,7 @@ { - "debug.node.autoAttach": "disabled" + "debug.node.autoAttach": "disabled", + "python.pythonPath": "/workspace/frappe-bench/env/bin/python", + "python.analysis.extraPaths": [ + "./frappe-bench/apps/frappe" + ], } From b02191f3f83f70b10352a3e117b47261da0426f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 6 Feb 2022 21:43:22 +0530 Subject: [PATCH 8/9] chore(deps): Update pre-commit hooks (#652) Co-authored-by: vrslev --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ea58a5b..b7ed7bbb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: types: [shell] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.8.0.3 + rev: v0.8.0.4 hooks: - id: shellcheck args: [-x] From 05853825d874859a04a58fcb4ec8d7b9b0cbab76 Mon Sep 17 00:00:00 2001 From: Lev Date: Tue, 8 Feb 2022 11:35:52 +0300 Subject: [PATCH 9/9] build: Change bench target names and move CI to separate workflow (#655) * Change bench target names and move CI to separate workflow * Fix file detection --- .github/workflows/build_bench.yml | 46 +++++++++++++++++++++++++++++ .github/workflows/build_develop.yml | 33 +-------------------- build/bench/Dockerfile | 4 +-- docker-bake.hcl | 12 ++++---- 4 files changed, 55 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/build_bench.yml diff --git a/.github/workflows/build_bench.yml b/.github/workflows/build_bench.yml new file mode 100644 index 00000000..b2f55fae --- /dev/null +++ b/.github/workflows/build_bench.yml @@ -0,0 +1,46 @@ +name: Bench + +on: + pull_request: + branches: + - main + paths: + - build/bench/** + - docker-bake.hcl + + schedule: + # Every day at 12:00 pm + - cron: 0 0 * * * + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and test + uses: docker/bake-action@v1.6.0 + with: + files: docker-bake.hcl + targets: bench-test + + - name: Login + if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push + if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} + uses: docker/bake-action@v1.6.0 + with: + targets: bench + files: docker-bake.hcl + push: true diff --git a/.github/workflows/build_develop.yml b/.github/workflows/build_develop.yml index 3e3cc9a1..3d0320ad 100644 --- a/.github/workflows/build_develop.yml +++ b/.github/workflows/build_develop.yml @@ -23,38 +23,7 @@ env: IS_AUTHORIZED_RUN: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} jobs: - build_bench: - name: Bench - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login - uses: docker/login-action@v1 - if: env.IS_AUTHORIZED_RUN == 'true' - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and test - uses: docker/bake-action@v1.6.0 - with: - files: docker-bake.hcl - targets: bench-test - - - name: Push - uses: docker/bake-action@v1.6.0 - if: env.IS_AUTHORIZED_RUN == 'true' - with: - files: docker-bake.hcl - targets: bench-build - push: true - - build_main: + build: name: Frappe & ERPNext runs-on: ubuntu-latest services: diff --git a/build/bench/Dockerfile b/build/bench/Dockerfile index 89feb145..a963425e 100644 --- a/build/bench/Dockerfile +++ b/build/bench/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim as build +FROM debian:bullseye-slim as bench LABEL author=frappé @@ -125,7 +125,7 @@ RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | EXPOSE 8000-8005 9000-9005 6787 -FROM build as test +FROM bench as bench-test # Print version and verify bashrc is properly sourced so that everything works # in the interactive shell and Dockerfile diff --git a/docker-bake.hcl b/docker-bake.hcl index 39379284..51f69ba3 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -2,17 +2,17 @@ # Reference: https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md -# Bench images +# Bench image -target "bench-build" { +target "bench" { + context = "build/bench" + target = "bench" tags = ["frappe/bench:latest"] - dockerfile = "build/bench/Dockerfile" - target = "build" } target "bench-test" { - inherits = ["bench-build"] - target = "test" + inherits = ["bench"] + target = "bench-test" } # Main images