Skip to content

Commit

Permalink
updated commands by adding --command
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed Jul 25, 2024
1 parent ed55d44 commit a95fb8d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 1 addition & 8 deletions imageroot/systemd/user/backend.service
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/backend.pid \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE}
ExecStartPost=/usr/bin/podman exec backend /bin/bash -c ' \
bench set-config -g db_host "db"; \
bench set-config -gp db_port "3306"; \
bench set-config -g redis_cache "redis://redis-cache:6379"; \
bench set-config -g redis_queue "redis://redis-cache:6379"; \
bench set-config -g redis_socketio "redis://redis-cache:6379"; \
bench set-config -gp socketio_port "9000"; \
'

ExecStop=/usr/bin/podman stop --ignore --cidfile %t/backend.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP backend
SyslogIdentifier=%u
Expand Down
4 changes: 3 additions & 1 deletion imageroot/systemd/user/configurator.service
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ ExecStartPre=/bin/rm -f %t/configurator.pid %t/configurator.ctr-id
ExecStart=/usr/bin/podman run --conmon-pidfile %t/configurator.pid \
--cidfile %t/configurator.ctr-id --cgroups=no-conmon \
--pod-id-file %t/erp-next.pod-id --replace -d --name configurator \
--entrypoint '["bash", "-c"]' \
--command 'ls -1 apps > sites/apps.txt; bench set-config -g db_host db; bench set-config -gp db_port 3306; bench set-config -g redis_cache "redis://redis-cache:6379"; bench set-config -g redis_queue "redis://redis-cache:6379"; bench set-config -g redis_socketio "redis://redis-cache:6379"; bench set-config -gp socketio_port 9000;' \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
-e DB_HOST=db \
-e DB_PORT=3306 \
-e REDIS_CACHE=redis-cache:6379 \
-e REDIS_QUEUE=redis-cache:6379 \
-e SOCKETIO_PORT=9000 \
${ERPNEXT_IMAGE} /bin/bash -c "bench set-config -g db_host 'db' && bench set-config -gp db_port '3306' && bench set-config -g redis_cache 'redis://redis-cache:6379' && bench set-config -g redis_queue 'redis://redis-cache:6379' && bench set-config -g redis_socketio 'redis://redis-cache:6379' && bench set-config -gp socketio_port '9000'"
${ERPNEXT_IMAGE}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/configurator.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP configurator
SyslogIdentifier=%u
Expand Down
2 changes: 2 additions & 0 deletions imageroot/systemd/user/create-site.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ExecStartPre=/bin/rm -f %t/create-site.pid %t/create-site.ctr-id
ExecStart=/usr/bin/podman run --conmon-pidfile %t/create-site.pid \
--cidfile %t/create-site.ctr-id --cgroups=no-conmon \
--pod-id-file %t/erp-next.pod-id --replace -d --name create-site \
--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-cache: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 --no-mariadb-socket --admin-password=Nethesis1234 --db-root-password=Nethesis1234 --install-app erpnext --set-default frontend;' \
-v sites:/home/frappe/frappe-bench/sites \
-v logs:/home/frappe/frappe-bench/logs \
${ERPNEXT_IMAGE} bench new-site --no-mariadb-socket --admin-password=Nethesis1234 --db-root-password=Nethesis1234 --install-app erpnext --set-default frontend
Expand Down

0 comments on commit a95fb8d

Please sign in to comment.