Remove git reference from install-app

Also fixed issue with missing sites/assets folder
This commit is contained in:
Lev Vereshchagin 2022-03-29 12:15:43 +03:00
parent 486b36ca76
commit 037c6f340a
4 changed files with 12 additions and 19 deletions

View file

@ -14,10 +14,9 @@ RUN mkdir -p sites/assets /out/assets \
&& echo frappe >sites/apps.txt && echo frappe >sites/apps.txt
ARG FRAPPE_VERSION ARG FRAPPE_VERSION
RUN git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe apps/frappe
# Install development node modules # Install development node modules
RUN yarn --cwd apps/frappe \ RUN git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe 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 # 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 \ && if [ ! -f sites/.build ]; then touch sites/.build; fi \
&& cp sites/.build /out && cp sites/.build /out
@ -33,7 +32,8 @@ RUN install-app frappe
FROM assets_builder as erpnext_assets FROM assets_builder as erpnext_assets
ARG ERPNEXT_VERSION ARG ERPNEXT_VERSION
RUN install-app erpnext ${ERPNEXT_VERSION} https://github.com/frappe/erpnext RUN git clone --depth 1 -b ${ERPNEXT_VERSION} https://github.com/frappe/erpnext apps/erpnext \
&& install-app erpnext
FROM alpine/git as bench FROM alpine/git as bench

View file

@ -2,15 +2,10 @@
set -e set -e
set -x set -x
APP=$1 BRANCH=$2 GIT_URL=$3 APP=$1
cd /frappe-bench cd /frappe-bench
if test "$BRANCH" && test "$GIT_URL"; then
# Clone in case not copied manually
git clone --depth 1 -b "$BRANCH" "$GIT_URL" "apps/$APP"
fi
# Add all not built assets # Add all not built assets
cp -r "apps/$APP/$APP/public" "/out/assets/$APP" cp -r "apps/$APP/$APP/public" "/out/assets/$APP"
@ -26,4 +21,4 @@ cp -r sites/assets /out
# Cleanup # Cleanup
rm -rf "apps/$APP" rm -rf "apps/$APP"
rm -rf sites/assets rm -rf sites/assets/*

View file

@ -43,7 +43,8 @@ FROM build_deps as frappe_builder
ARG FRAPPE_VERSION ARG FRAPPE_VERSION
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
install-app frappe ${FRAPPE_VERSION} https://github.com/frappe/frappe \ git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe apps/frappe \
&& install-app frappe \
&& env/bin/pip install -U gevent \ && env/bin/pip install -U gevent \
# Link Frappe's node_modules/ to make Website Theme work # Link Frappe's node_modules/ to make Website Theme work
&& mkdir -p /home/frappe/frappe-bench/sites/assets/frappe/node_modules \ && mkdir -p /home/frappe/frappe-bench/sites/assets/frappe/node_modules \
@ -54,7 +55,8 @@ FROM frappe_builder as erpnext_builder
ARG ERPNEXT_VERSION ARG ERPNEXT_VERSION
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
install-app erpnext ${ERPNEXT_VERSION} https://github.com/frappe/erpnext git clone --depth 1 -b ${ERPNEXT_VERSION} https://github.com/frappe/erpnext apps/erpnext \
&& install-app erpnext
FROM base as configured_base FROM base as configured_base

View file

@ -2,15 +2,11 @@
set -e set -e
set -x set -x
APP=$1 BRANCH=$2 GIT_URL=$3 APP=$1
cd /home/frappe/frappe-bench cd /home/frappe/frappe-bench
if test "$BRANCH" && test "$GIT_URL"; then rm -rf "apps/$APP/.git"
# Clone in case not copied manually
git clone --depth 1 -b "$BRANCH" "$GIT_URL" "apps/$APP"
rm -r "apps/$APP/.git"
fi
env/bin/pip install -e "apps/$APP" env/bin/pip install -e "apps/$APP"