Remove git reference from install-app (#742)
* Remove git reference from install-app Also fixed issue with missing sites/assets folder * Update custom app guide according to changes * Ignore apps that have no frontend code instead of failing
This commit is contained in:
parent
6759bebab5
commit
ca9761585a
@ -41,4 +41,6 @@ Cool! You just containerized your app!
|
|||||||
|
|
||||||
## Installing multiple apps
|
## Installing multiple apps
|
||||||
|
|
||||||
Both backend and frontend builds contain `install-app` script that places app where it should be. Each call to script installs given app. Usage: `install-app [APP_NAME] [BRANCH?] [GIT_URL?]`.
|
Both backend and frontend builds contain `install-app` script that places app where it should be. Each call to script installs given app. Usage: `install-app [APP_NAME]`.
|
||||||
|
|
||||||
|
If you want to install an app from git, clone it locally, COPY in Dockerfile.
|
||||||
|
@ -11,10 +11,4 @@ COPY . ../apps/${APP_NAME}
|
|||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
install-app ${APP_NAME}
|
install-app ${APP_NAME}
|
||||||
|
|
||||||
# or with git:
|
|
||||||
# ARG APP_NAME
|
|
||||||
# ARG BRANCH
|
|
||||||
# ARG GIT_URL
|
|
||||||
# RUN install-assets ${APP_NAME} ${BRANCH} ${GIT_URL}
|
|
||||||
|
|
||||||
USER frappe
|
USER frappe
|
||||||
|
@ -7,12 +7,6 @@ ARG APP_NAME
|
|||||||
COPY . apps/${APP_NAME}
|
COPY . apps/${APP_NAME}
|
||||||
RUN install-app ${APP_NAME}
|
RUN install-app ${APP_NAME}
|
||||||
|
|
||||||
# or with git:
|
|
||||||
# ARG APP_NAME
|
|
||||||
# ARG BRANCH
|
|
||||||
# ARG GIT_URL
|
|
||||||
# RUN install-app ${APP_NAME} ${BRANCH} ${GIT_URL}
|
|
||||||
|
|
||||||
|
|
||||||
FROM frappe/erpnext-nginx:${ERPNEXT_VERSION}
|
FROM frappe/erpnext-nginx:${ERPNEXT_VERSION}
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -2,13 +2,18 @@
|
|||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
APP=$1 BRANCH=$2 GIT_URL=$3
|
APP=$1
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -rf "apps/$APP"
|
||||||
|
rm -rf sites/assets/*
|
||||||
|
}
|
||||||
|
|
||||||
cd /frappe-bench
|
cd /frappe-bench
|
||||||
|
|
||||||
if test "$BRANCH" && test "$GIT_URL"; then
|
if ! test -d "apps/$APP/$APP/public"; then
|
||||||
# Clone in case not copied manually
|
cleanup
|
||||||
git clone --depth 1 -b "$BRANCH" "$GIT_URL" "apps/$APP"
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add all not built assets
|
# Add all not built assets
|
||||||
@ -24,6 +29,4 @@ echo "$APP" >>sites/apps.txt
|
|||||||
yarn --cwd apps/frappe run production --app "$APP"
|
yarn --cwd apps/frappe run production --app "$APP"
|
||||||
cp -r sites/assets /out
|
cp -r sites/assets /out
|
||||||
|
|
||||||
# Cleanup
|
cleanup
|
||||||
rm -rf "apps/$APP"
|
|
||||||
rm -rf sites/assets
|
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user