2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-09-20 11:09:01 +00:00
frappe_docker/build/erpnext-nginx/install_app.sh
Lev 7c157aa487
refactor: Dockerfiles (#555)
* refactor(frappe-worker): Dockerfile

* fix(frappe-worker): Cloning frappe repo

* refactor(frappe-nginx): Dockerfile

* refactor(erpnext-nginx): Dockerfile

* chore(frappe-worker): Add space in Dockerfile

* refactor(bench): Dockerfile

* refactor(frappe-socketio): Dockerfile

* ci(Test): Add `workflow_dispatch` trigger

* fix(bench): Uncomment missing package

* fix(bench): Replace legacy `libmariadbclient-dev` with `libmariadb-dev`

* refactor(erpnext-nginx): Install script

- Remove repetitive code
- Don't explicitly install production deps (they are installed via plain `yarn` with dev deps)
- Don't write to lockfiles

* fix(erpnext-nginx): use -e flag, fix installation

* fix(erpnext-nginx): Don't install unused wget

* fix(frappe-nginx): Get newest certificates

* fix: Install ca-certificates on erpnext-nginx instead of frappe-nginx

* trigger ci

* ci(test): Fix trigger duplicate

* chore: Fix linting
2021-11-10 04:43:46 +05:30

41 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
APP_NAME=${1}
APP_REPO=${2}
APP_BRANCH=${3}
FRAPPE_BRANCH=${4}
[ "${APP_BRANCH}" ] && BRANCH="-b ${APP_BRANCH}"
mkdir -p /home/frappe/frappe-bench
cd /home/frappe/frappe-bench
mkdir -p apps "sites/assets/${APP_NAME}"
echo -ne "frappe\n${APP_NAME}" >sites/apps.txt
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}
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}"
cd /home/frappe/frappe-bench
# shellcheck disable=SC2086
cp -R apps/${APP_NAME}/${APP_NAME}/public/* sites/assets/${APP_NAME}
# 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
rm sites/apps.txt