diff --git a/.github/scripts/get_latest_tags.py b/.github/scripts/get_latest_tags.py index c1f2cdc5..b2e083c4 100644 --- a/.github/scripts/get_latest_tags.py +++ b/.github/scripts/get_latest_tags.py @@ -19,6 +19,8 @@ def get_latest_tag(repo: Repo, version: MajorVersion) -> str: refs = subprocess.check_output( ( "git", + "-c", + "versionsort.suffix=-", "ls-remote", "--refs", "--tags", diff --git a/images/nginx/Dockerfile b/images/nginx/Dockerfile index 95c86883..eb4da5cc 100644 --- a/images/nginx/Dockerfile +++ b/images/nginx/Dockerfile @@ -32,9 +32,14 @@ RUN install-app frappe FROM assets_builder as erpnext_assets +ARG PAYMENTS_VERSION=develop +ARG PAYMENTS_REPO=https://github.com/frappe/payments ARG ERPNEXT_VERSION ARG ERPNEXT_REPO=https://github.com/frappe/erpnext -RUN git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \ +RUN if [ -z "${ERPNEXT_VERSION##*v14*}" ] || [ "$ERPNEXT_VERSION" = "develop" ]; then \ + git clone --depth 1 -b ${PAYMENTS_VERSION} ${PAYMENTS_REPO} apps/payments && install-app payments; \ + fi \ + && git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \ && install-app erpnext diff --git a/images/worker/Dockerfile b/images/worker/Dockerfile index 77fb2588..40c09945 100644 --- a/images/worker/Dockerfile +++ b/images/worker/Dockerfile @@ -54,10 +54,15 @@ RUN --mount=type=cache,target=/root/.cache/pip \ FROM frappe_builder as erpnext_builder +ARG PAYMENTS_VERSION=develop +ARG PAYMENTS_REPO=https://github.com/frappe/payments ARG ERPNEXT_VERSION ARG ERPNEXT_REPO=https://github.com/frappe/erpnext RUN --mount=type=cache,target=/root/.cache/pip \ - git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \ + if [ -z "${ERPNEXT_VERSION##*v14*}" ] || [ "$ERPNEXT_VERSION" = "develop" ]; then \ + git clone --depth 1 -b ${PAYMENTS_VERSION} ${PAYMENTS_REPO} apps/payments && install-app payments; \ + fi \ + && git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \ && install-app erpnext @@ -122,8 +127,7 @@ USER frappe # Split frappe and erpnext to reduce image size (because of frappe-bench/env/ directory) FROM configured_base as erpnext -COPY --from=frappe_builder /home/frappe/frappe-bench/apps/frappe /home/frappe/frappe-bench/apps/frappe -COPY --from=erpnext_builder /home/frappe/frappe-bench/apps/erpnext /home/frappe/frappe-bench/apps/erpnext +COPY --from=erpnext_builder /home/frappe/frappe-bench/apps /home/frappe/frappe-bench/apps COPY --from=erpnext_builder /home/frappe/frappe-bench/env /home/frappe/frappe-bench/env COPY --from=erpnext_builder /home/frappe/frappe-bench/sites/apps.txt /home/frappe/frappe-bench/sites/ diff --git a/tests/conftest.py b/tests/conftest.py index 2b531f33..f9885dd1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -81,7 +81,7 @@ def erpnext_setup(compose: Compose): @pytest.fixture(scope="class") def erpnext_site(compose: Compose): site_name = "test_erpnext_site" - compose.bench( + args = [ "new-site", site_name, "--mariadb-root-password", @@ -90,7 +90,14 @@ def erpnext_site(compose: Compose): "admin", "--install-app", "erpnext", - ) + ] + erpnext_version = os.environ.get("ERPNEXT_VERSION") + if erpnext_version in [ + "develop", + "version-14", + ] or erpnext_version.startswith("v14"): + args.append("--install-app=payments") + compose.bench(*args) compose("restart", "backend") yield site_name