2020-03-04 03:33:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
APP_NAME=${1}
|
|
|
|
APP_REPO=${2}
|
|
|
|
APP_BRANCH=${3}
|
2021-06-08 16:01:08 +05:30
|
|
|
FRAPPE_BRANCH=${4}
|
2020-03-04 03:33:38 +00:00
|
|
|
|
2020-03-07 05:33:32 +05:30
|
|
|
[ "${APP_BRANCH}" ] && BRANCH="-b ${APP_BRANCH}"
|
2020-03-04 03:33:38 +00:00
|
|
|
|
2020-03-07 15:47:50 +05:30
|
|
|
mkdir -p /home/frappe/frappe-bench/sites/assets
|
2020-03-04 03:33:38 +00:00
|
|
|
cd /home/frappe/frappe-bench
|
2021-06-23 09:13:24 +05:30
|
|
|
echo -ne "frappe\n${APP_NAME}" >/home/frappe/frappe-bench/sites/apps.txt
|
2020-03-04 03:33:38 +00:00
|
|
|
|
2020-03-07 15:47:50 +05:30
|
|
|
mkdir -p apps
|
2020-03-04 03:33:38 +00:00
|
|
|
cd apps
|
2021-06-08 16:01:08 +05:30
|
|
|
git clone --depth 1 https://github.com/frappe/frappe -b ${FRAPPE_BRANCH}
|
2020-11-24 19:23:54 +08:00
|
|
|
git clone --depth 1 ${APP_REPO} ${BRANCH} ${APP_NAME}
|
2020-03-04 03:33:38 +00:00
|
|
|
|
2021-02-21 07:38:18 +05:30
|
|
|
echo "Install frappe NodeJS dependencies . . ."
|
2020-03-04 03:33:38 +00:00
|
|
|
cd /home/frappe/frappe-bench/apps/frappe
|
|
|
|
yarn
|
2021-02-21 07:38:18 +05:30
|
|
|
echo "Install ${APP_NAME} NodeJS dependencies . . ."
|
|
|
|
cd /home/frappe/frappe-bench/apps/${APP_NAME}
|
|
|
|
yarn
|
|
|
|
echo "Build browser assets . . ."
|
|
|
|
cd /home/frappe/frappe-bench/apps/frappe
|
2020-06-29 23:28:10 +05:30
|
|
|
yarn production --app ${APP_NAME}
|
2021-02-21 07:38:18 +05:30
|
|
|
echo "Install frappe NodeJS production dependencies . . ."
|
|
|
|
cd /home/frappe/frappe-bench/apps/frappe
|
|
|
|
yarn install --production=true
|
|
|
|
echo "Install ${APP_NAME} NodeJS production dependencies . . ."
|
|
|
|
cd /home/frappe/frappe-bench/apps/${APP_NAME}
|
2020-03-04 03:33:38 +00:00
|
|
|
yarn install --production=true
|
|
|
|
|
|
|
|
mkdir -p /home/frappe/frappe-bench/sites/assets/${APP_NAME}
|
|
|
|
cp -R /home/frappe/frappe-bench/apps/${APP_NAME}/${APP_NAME}/public/* /home/frappe/frappe-bench/sites/assets/${APP_NAME}
|
|
|
|
|
2020-07-10 23:15:36 +05:30
|
|
|
# Add frappe and all the apps available under in frappe-bench here
|
2021-06-23 09:13:24 +05:30
|
|
|
echo "rsync -a --delete /var/www/html/assets/frappe /assets" >/rsync
|
|
|
|
echo "rsync -a --delete /var/www/html/assets/${APP_NAME} /assets" >>/rsync
|
2020-03-20 05:21:30 +05:30
|
|
|
chmod +x /rsync
|
2020-03-05 02:28:42 +00:00
|
|
|
|
2020-03-20 05:21:30 +05:30
|
|
|
rm /home/frappe/frappe-bench/sites/apps.txt
|