2020-03-04 03:33:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
APP_NAME=${1}
|
|
|
|
APP_REPO=${2}
|
|
|
|
APP_BRANCH=${3}
|
|
|
|
|
2020-03-07 00:03:32 +00:00
|
|
|
[ "${APP_BRANCH}" ] && BRANCH="-b ${APP_BRANCH}"
|
2020-03-04 03:33:38 +00:00
|
|
|
|
2020-03-07 10:17:50 +00:00
|
|
|
mkdir -p /home/frappe/frappe-bench/sites/assets
|
2020-03-04 03:33:38 +00:00
|
|
|
cd /home/frappe/frappe-bench
|
2020-03-07 11:15:53 +00:00
|
|
|
echo -e "frappe\n${APP_NAME}" > /home/frappe/frappe-bench/sites/apps.txt
|
2020-03-04 03:33:38 +00:00
|
|
|
|
2020-03-07 10:17:50 +00:00
|
|
|
mkdir -p apps
|
2020-03-04 03:33:38 +00:00
|
|
|
cd apps
|
|
|
|
git clone --depth 1 https://github.com/frappe/frappe ${BRANCH}
|
2020-11-24 11:23:54 +00:00
|
|
|
git clone --depth 1 ${APP_REPO} ${BRANCH} ${APP_NAME}
|
2020-03-04 03:33:38 +00:00
|
|
|
|
|
|
|
cd /home/frappe/frappe-bench/apps/frappe
|
|
|
|
yarn
|
2020-06-29 17:58:10 +00:00
|
|
|
yarn production --app ${APP_NAME}
|
2020-03-04 03:33:38 +00:00
|
|
|
rm -fr node_modules
|
|
|
|
yarn install --production=true
|
2020-09-02 16:43:50 +00:00
|
|
|
yarn add node-sass
|
2020-03-04 03:33:38 +00:00
|
|
|
|
|
|
|
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 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
|
2020-03-19 23:51:30 +00:00
|
|
|
chmod +x /rsync
|
2020-03-05 02:28:42 +00:00
|
|
|
|
2020-03-19 23:51:30 +00:00
|
|
|
rm /home/frappe/frappe-bench/sites/apps.txt
|