From 4e96a16ee26e0f3e5b05c3680f25942f03994af6 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 28 Dec 2022 21:19:04 +0530 Subject: [PATCH] docs: fix lint errors --- docs/list-of-containers.md | 2 +- docs/migrate-from-multi-image-setup.md | 123 +++++++++++++------------ 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/docs/list-of-containers.md b/docs/list-of-containers.md index d4562f4f..c22da832 100644 --- a/docs/list-of-containers.md +++ b/docs/list-of-containers.md @@ -53,4 +53,4 @@ docker-compose -f compose.yaml -f overrides/compose.redis.yaml config That's it! Of course, we also have to setup `.env` before all of that, but that's not the point. -Check [environment variables](environment-variables.md) for more. \ No newline at end of file +Check [environment variables](environment-variables.md) for more. diff --git a/docs/migrate-from-multi-image-setup.md b/docs/migrate-from-multi-image-setup.md index c7616b9b..5887d0c1 100644 --- a/docs/migrate-from-multi-image-setup.md +++ b/docs/migrate-from-multi-image-setup.md @@ -14,15 +14,15 @@ Example change: ```yaml # ... removed for brevity - frontend: - image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} - command: - - nginx-entrypoint.sh - environment: - BACKEND: backend:8000 - SOCKETIO: websocket:9000 - volumes: - - sites:/home/frappe/frappe-bench/sites +frontend: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + command: + - nginx-entrypoint.sh + environment: + BACKEND: backend:8000 + SOCKETIO: websocket:9000 + volumes: + - sites:/home/frappe/frappe-bench/sites # ... removed for brevity ``` @@ -34,11 +34,11 @@ Example change: ```yaml # ... removed for brevity - websocket: - image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} - command: - - node - - /home/frappe/frappe-bench/apps/frappe/socketio.js +websocket: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + command: + - node + - /home/frappe/frappe-bench/apps/frappe/socketio.js # ... removed for brevity ``` @@ -50,27 +50,27 @@ Example change: ```yaml # ... removed for brevity - configurator: - image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} - restart: "no" - entrypoint: - - bash - - -c - command: - - > - bench set-config -g db_host $$DB_HOST; - bench set-config -gp db_port $$DB_PORT; - bench set-config -g redis_cache "redis://$$REDIS_CACHE"; - bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; - bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO"; - bench set-config -gp socketio_port $$SOCKETIO_PORT; - environment: - DB_HOST: db - DB_PORT: "3306" - REDIS_CACHE: redis-cache:6379 - REDIS_QUEUE: redis-queue:6379 - REDIS_SOCKETIO: redis-socketio:6379 - SOCKETIO_PORT: "9000" +configurator: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + restart: "no" + entrypoint: + - bash + - -c + command: + - > + bench set-config -g db_host $$DB_HOST; + bench set-config -gp db_port $$DB_PORT; + bench set-config -g redis_cache "redis://$$REDIS_CACHE"; + bench set-config -g redis_queue "redis://$$REDIS_QUEUE"; + bench set-config -g redis_socketio "redis://$$REDIS_SOCKETIO"; + bench set-config -gp socketio_port $$SOCKETIO_PORT; + environment: + DB_HOST: db + DB_PORT: "3306" + REDIS_CACHE: redis-cache:6379 + REDIS_QUEUE: redis-queue:6379 + REDIS_SOCKETIO: redis-socketio:6379 + SOCKETIO_PORT: "9000" # ... removed for brevity ``` @@ -84,31 +84,32 @@ Example change: ```yaml # ... removed for brevity - create-site: - image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} - restart: "no" - entrypoint: - - bash - - -c - command: - - > - wait-for-it -t 120 db:3306; - wait-for-it -t 120 redis-cache:6379; - wait-for-it -t 120 redis-queue:6379; - wait-for-it -t 120 redis-socketio:6379; - export start=`date +%s`; - until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ - [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \ - [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]]; - do - echo "Waiting for sites/common_site_config.json to be created"; - sleep 5; - if (( `date +%s`-start > 120 )); then - echo "could not find sites/common_site_config.json with required keys"; - exit 1 - fi - done; - echo "sites/common_site_config.json found"; - bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app payments --install-app erpnext --set-default; +create-site: + image: frappe/erpnext:${ERPNEXT_VERSION:?ERPNext version not set} + restart: "no" + entrypoint: + - bash + - -c + command: + - > + wait-for-it -t 120 db:3306; + wait-for-it -t 120 redis-cache:6379; + wait-for-it -t 120 redis-queue:6379; + wait-for-it -t 120 redis-socketio:6379; + export start=`date +%s`; + until [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".db_host // empty"` ]] && \ + [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_cache // empty"` ]] && \ + [[ -n `grep -hs ^ sites/common_site_config.json | jq -r ".redis_queue // empty"` ]]; + do + echo "Waiting for sites/common_site_config.json to be created"; + sleep 5; + if (( `date +%s`-start > 120 )); then + echo "could not find sites/common_site_config.json with required keys"; + exit 1 + fi + done; + echo "sites/common_site_config.json found"; + bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app payments --install-app erpnext --set-default; + # ... removed for brevity ```