2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 06:15:26 +00:00

fix: install frappe/payments for v14 and develop (#867)

* fix: install frappe/payments for v14 and develop

* fix: test installs payments as per version

* fix: copy all apps for erpnext images

* fix: test installs payments on version-14

* fix: get_latest_tags script

* fix: docker build condition for v14
This commit is contained in:
Revant Nandgaonkar 2022-08-02 06:01:13 +05:30 committed by GitHub
parent 5c74ff9407
commit 6fa946a630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 6 deletions

View File

@ -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",

View File

@ -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

View File

@ -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/

View File

@ -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