feat: allow custom git repos (#771)

fixes #770
This commit is contained in:
Revant Nandgaonkar
2022-04-11 10:30:16 +05:30
committed by GitHub
parent bc915f7b34
commit 5edac4c12a
4 changed files with 30 additions and 6 deletions

View File

@@ -14,8 +14,9 @@ RUN mkdir -p sites/assets /out/assets \
&& echo frappe >sites/apps.txt
ARG FRAPPE_VERSION
ARG FRAPPE_REPO=https://github.com/frappe/frappe
# Install development node modules
RUN git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe apps/frappe \
RUN git clone --depth 1 -b ${FRAPPE_VERSION} ${FRAPPE_REPO} apps/frappe \
&& yarn --cwd apps/frappe \
# TODO: Currently `yarn run production` doesn't create .build on develop branch: https://github.com/frappe/frappe/issues/15396
&& if [ ! -f sites/.build ]; then touch sites/.build; fi \
@@ -32,14 +33,16 @@ RUN install-app frappe
FROM assets_builder as erpnext_assets
ARG ERPNEXT_VERSION
RUN git clone --depth 1 -b ${ERPNEXT_VERSION} https://github.com/frappe/erpnext apps/erpnext \
ARG ERPNEXT_REPO=https://github.com/frappe/erpnext
RUN git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \
&& install-app erpnext
FROM alpine/git as bench
# Error pages
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
ARG BENCH_REPO=https://github.com/frappe/bench
RUN git clone --depth 1 ${BENCH_REPO} /tmp/bench \
&& mkdir /out \
&& mv /tmp/bench/bench/config/templates/502.html /out/

View File

@@ -1,7 +1,8 @@
FROM alpine/git as builder
ARG FRAPPE_VERSION
RUN git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe /opt/frappe
ARG FRAPPE_REPO=https://github.com/frappe/frappe
RUN git clone --depth 1 -b ${FRAPPE_VERSION} ${FRAPPE_REPO} /opt/frappe
FROM node:17-alpine

View File

@@ -42,8 +42,9 @@ RUN apt-get update \
FROM build_deps as frappe_builder
ARG FRAPPE_VERSION
ARG FRAPPE_REPO=https://github.com/frappe/frappe
RUN --mount=type=cache,target=/root/.cache/pip \
git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe apps/frappe \
git clone --depth 1 -b ${FRAPPE_VERSION} ${FRAPPE_REPO} apps/frappe \
&& install-app frappe \
&& env/bin/pip install -U gevent \
# Link Frappe's node_modules/ to make Website Theme work
@@ -54,8 +55,9 @@ RUN --mount=type=cache,target=/root/.cache/pip \
FROM frappe_builder as erpnext_builder
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} https://github.com/frappe/erpnext apps/erpnext \
git clone --depth 1 -b ${ERPNEXT_VERSION} ${ERPNEXT_REPO} apps/erpnext \
&& install-app erpnext