fixed travis and added a bit to dbench

This commit is contained in:
chabad360 2018-08-01 19:56:56 -07:00
parent 3c469b0e4a
commit bf83486dcc
2 changed files with 10 additions and 10 deletions

View file

@ -12,9 +12,8 @@ services:
- docker
install:
- docker-compose build
- docker-compose up -d
- ./dbench init
- ./dbench --setup
- ./dbench --init
- pip install --upgrade virtualenv
- virtualenv -p python3 testenv
- source testenv/bin/activate

15
dbench
View file

@ -7,7 +7,7 @@ function usage {
echo ' -h show this help text'
echo ' -d [sitename] enables developer mode for specified site'
echo ' -a adds site-names to /etc/hosts file in the container to facilitate multisite access'
echo ' --setup starts up and builds docker'
echo ' --setup starts up and builds docker, NOTE: assumes you have docker installed'
echo ' --init [-e | -d] [sitename] initializes frappe-bench in docker and adds a site "sitename" (if not specified, it will default to site1.local)'
echo ' -e initializes frappe-bench and installs erpnext'
echo ' -d initializes frappe-bench and enables developer mode'
@ -29,21 +29,21 @@ function frappe_installer {
if [[ $# -eq 0 ]]; then
docker exec -it frappe bash 'bench $@'
elif [ $1 == '--init' ]; then
site=$2
if ! $2; then set -- "${@:1}" "site1.local"; fi
if ! $3; then set -- "${@:1:2}" "site1.local" && site=$3; fi
if ! $4; then set -- "${@:1:2:3}" "site1.local" && site=$4; fi
frappe_installer $site
if [ $2 == '-e' ]; then
if [ "$2" == '-e' ]; then
echo "installing erpnext"
docker exec -it frappe bash -c "bench get-app erpnext"
docker exec -it frappe bash -c "bench --site $site install-app erpnext"
echo "finished"
elif [ $2 == '-d' ]; then
elif [ "$2" == '-d' ]; then
docker exec -it -u root frappe bash -c "bench --site $site set-config \"developer_mode\" 1 && bench clear-cache"
elif [ $2 == '-ed' ]; then
elif [ "$2" == '-ed' ]; then
echo "installing erpnext"
docker exec -it frappe bash -c "bench get-app erpnext"
docker exec -it frappe bash -c "bench --site $site install-app erpnext"
@ -51,8 +51,9 @@ elif [ $1 == '--init' ]; then
echo "finished"
fi
elif [ $1 == '--setup' ]; then
frappe_installer
elif [ "$1" == '--setup' ]; then
docker-compose build
docker-compose up -d
else
while getopts ':had:' option; do
case "$option" in