From 643dd4b4cea163fb3a2d59b08d2c1b03e707ca25 Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Fri, 6 Oct 2017 13:55:55 +0530 Subject: [PATCH 1/4] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 62fc03e8..ead77afa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get install -y wkhtmltopdf USER frappe WORKDIR /home/frappe -RUN git clone -b develop https://github.com/vishalseshagiri/bench.git bench-repo +RUN git clone -b develop https://github.com/frappe/bench.git bench-repo USER root RUN pip install -e bench-repo From 656386c44b1d482fe03ea8aa8e7406e8a3fb3ec6 Mon Sep 17 00:00:00 2001 From: pzdge23 Date: Mon, 9 Oct 2017 08:45:52 +0530 Subject: [PATCH 2/4] added init option --- dbench | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/dbench b/dbench index 9e339a66..d51a3e8d 100755 --- a/dbench +++ b/dbench @@ -4,13 +4,27 @@ display_usage() { echo "$(basename "$0") [-h] [-c \"\"]" echo '' echo 'where:' - echo ' -h show this help text' - echo ' -c execute a command inside docker using docker exec' - echo ' -s adds site-names to /etc/hosts file in the container to facilitate multisite access' + echo ' -h show this help text' + echo ' -c execute a command inside docker using docker exec' + echo ' -s adds site-names to /etc/hosts file in the container to facilitate multisite access' + echo ' init initializes frappe-bench adds a new-site bench-manager.local and installs the bench_manager app + app onto it' } if [[ $# -eq 0 ]]; then docker exec -it frappe bash + +elif [ $1 == 'init' ] +then + docker exec -i -u root frappe bash -c "cd /home/frappe && chown -R frappe:frappe ./*" + docker exec -it frappe bash -c "cd .. && bench init frappe-bench --skip-bench-mkdir --skip-redis-config-generation && cd frappe-bench" + docker exec -it frappe bash -c "mv Procfile_docker Procfile && mv sites/common_site_config_docker.json sites/common_site_config.json" + docker exec -it -u root frappe bash -c "apt-get install vim && apt-get install sudo && usermod -aG sudo frappe && printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe" + docker exec -it frappe bash -c "bench set-mariadb-host mariadb" + docker exec -it frappe bash -c "bench new-site bench-manager.local" + docker exec -it frappe bash -c "bench get-app bench_manager https://github.com/frappe/bench_manager" + docker exec -it frappe bash -c "bench --site bench-manager.local install-app bench_manager" + else while getopts ':hsc:' option; do case "$option" in @@ -19,7 +33,7 @@ else exit ;; c) - docker exec frappe bash -c "bench $OPTARG" + docker exec -it frappe bash -c "bench $OPTARG" ;; s) a=$(cd frappe-bench && ls sites/*/site_config.json | grep -o '/.\+/') @@ -28,6 +42,7 @@ else result="127.0.0.1 ${a}" echo $result docker exec -u root -i frappe bash -c "echo ${result} | tee --append /etc/hosts" + docker exec -itu root frappe bash -c "printf '# User rules for frappe\nfrappe ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/frappe" ;; \?) echo "Invalid option: -$OPTARG" >&2 From 89654cf58055c44eca14f01f1b8a7addb953782e Mon Sep 17 00:00:00 2001 From: pzdge23 Date: Mon, 9 Oct 2017 08:56:45 +0530 Subject: [PATCH 3/4] fixing travis build error --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87f5edd6..6c78c5e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,11 +14,12 @@ install: - docker exec -i frappe bash -c "cd .. && bench init frappe-bench --skip-bench-mkdir --skip-redis-config-generation && cd frappe-bench" - docker exec -i frappe bash -c "mv Procfile_docker Procfile && mv sites/common_site_config_docker.json sites/common_site_config.json" - docker exec -i frappe bash -c "bench new-site site1.local" - - docker exec -i frappe bash -c "bench get-app erpnext https://github.com/frappe/erpnext" - - docker exec -i frappe bash -c "bench --site site1.local install-app erpnext" - docker exec -i -u root frappe bash -c "echo 127.0.0.1 site1.local >> /etc/hosts" - sudo su -c 'echo 127.0.0.1 site1.local >> /etc/hosts' - - pip3 install requests + - pip install --upgrade virtualenv + - virtualenv -p python3 testenv + - source testenv/bin/activate + - pip install requests script: - docker-compose ps | grep -i frappe @@ -26,5 +27,5 @@ script: - docker-compose ps | grep -i redis-queue - docker-compose ps | grep -i redis-socketio - docker-compose ps | grep -i mariadb - - python3 test.py + - python test.py - docker-compose stop From f4a52d87469c59ca18e4cf57c5e7b6f340b343c8 Mon Sep 17 00:00:00 2001 From: vishalseshagiri Date: Mon, 9 Oct 2017 09:35:51 +0530 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 086cd683..a34d3133 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # frappe_docker -[![Build Status](https://travis-ci.org/frappe/frappe_docker.svg?branch=master)](https://travis-ci.org/frappe/frappe_docker) +[![Build Status](https://travis-ci.org/vishalseshagiri/frappe_docker.svg?branch=develop)](https://travis-ci.org/frappe/frappe_docker) - [Docker](https://docker.com/) is an open source project to pack, ship and run any Linux application in a lighter weight, faster container than a traditional virtual machine.