2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-10 15:20:55 +00:00
frappe_docker/build/erpnext-nginx/install_app.sh

41 lines
1.1 KiB
Bash
Raw Normal View History

2020-03-04 03:33:38 +00:00
#!/bin/bash
set -e
2020-03-04 03:33:38 +00:00
APP_NAME=${1}
APP_REPO=${2}
APP_BRANCH=${3}
FRAPPE_BRANCH=${4}
2020-03-04 03:33:38 +00:00
2020-03-07 00:03:32 +00:00
[ "${APP_BRANCH}" ] && BRANCH="-b ${APP_BRANCH}"
2020-03-04 03:33:38 +00:00
mkdir -p /home/frappe/frappe-bench
2020-03-04 03:33:38 +00:00
cd /home/frappe/frappe-bench
mkdir -p apps "sites/assets/${APP_NAME}"
echo -ne "frappe\n${APP_NAME}" >sites/apps.txt
2020-03-04 03:33:38 +00:00
git clone --depth 1 -b "${FRAPPE_BRANCH}" https://github.com/frappe/frappe apps/frappe
# shellcheck disable=SC2086
git clone --depth 1 ${BRANCH} ${APP_REPO} apps/${APP_NAME}
2020-03-04 03:33:38 +00:00
echo "Install frappe NodeJS dependencies . . ."
cd apps/frappe
yarn --pure-lockfile
echo "Install ${APP_NAME} NodeJS dependencies . . ."
yarn --pure-lockfile --cwd "../${APP_NAME}"
echo "Build ${APP_NAME} assets . . ."
yarn production --app "${APP_NAME}"
2020-03-04 03:33:38 +00:00
cd /home/frappe/frappe-bench
# shellcheck disable=SC2086
cp -R apps/${APP_NAME}/${APP_NAME}/public/* sites/assets/${APP_NAME}
2020-03-04 03:33:38 +00:00
2020-07-10 17:45:36 +00:00
# Add frappe and all the apps available under in frappe-bench here
echo "rsync -a --delete /var/www/html/assets/frappe /assets" >/rsync
echo "rsync -a --delete /var/www/html/assets/${APP_NAME} /assets" >>/rsync
chmod +x /rsync
2020-03-05 02:28:42 +00:00
rm sites/apps.txt