chore: fix supervisor startup sequence

This commit is contained in:
Karol Sójko
2023-02-08 11:37:21 +01:00
parent 8a79437668
commit fd10b4d585
2 changed files with 25 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ logfile=/tmp/supervisord.log
[program:syncing-server]
directory=/opt/server
command=docker/wait-for.sh %(ENV_DB_HOST)s %(ENV_DB_PORT)s && docker/wait-for.sh %(ENV_REDIS_HOST)s %(ENV_REDIS_PORT)s && yarn start:syncing-server
command=yarn supervisor:start:syncing-server
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/syncing-server.log
@@ -12,7 +12,7 @@ stderr_logfile=/var/lib/server/logs/syncing-server.err
[program:syncing-server-worker]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_SYNCING_SERVER_PORT)s && yarn start:syncing-server-worker
command=yarn supervisor:start:syncing-server-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/syncing-server-worker.log
@@ -20,7 +20,7 @@ stderr_logfile=/var/lib/server/logs/syncing-server-worker.err
[program:auth]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_SYNCING_SERVER_PORT)s && yarn start:auth
command=yarn supervisor:start:auth
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/auth.log
@@ -28,7 +28,7 @@ stderr_logfile=/var/lib/server/logs/auth.err
[program:auth-worker]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_AUTH_SERVER_PORT)s && yarn start:auth-worker
command=yarn supervisor:start:auth-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/auth-worker.log
@@ -36,7 +36,7 @@ stderr_logfile=/var/lib/server/logs/auth-worker.err
[program:files]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_AUTH_SERVER_PORT)s && yarn start:files
command=yarn supervisor:start:files
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/files.log
@@ -44,7 +44,7 @@ stderr_logfile=/var/lib/server/logs/files.err
[program:files-worker]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_FILES_SERVER_PORT)s && yarn start:files-worker
command=yarn supervisor:start:files-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/files-worker.log
@@ -52,7 +52,7 @@ stderr_logfile=/var/lib/server/logs/files-worker.err
[program:revisions]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_FILES_SERVER_PORT)s && yarn start:revisions
command=yarn supervisor:start:revisions
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/revisions.log
@@ -60,7 +60,7 @@ stderr_logfile=/var/lib/server/logs/revisions.err
[program:revisions-worker]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_REVISIONS_SERVER_PORT)s && yarn start:revisions-worker
command=yarn supervisor:start:revisions-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/revisions-worker.log
@@ -68,7 +68,7 @@ stderr_logfile=/var/lib/server/logs/revisions-worker.err
[program:api-gateway]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_REVISIONS_SERVER_PORT)s && yarn start:api-gateway
command=yarn supervisor:start:api-gateway
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/api-gateway.log

View File

@@ -37,6 +37,22 @@
"start:analytics": "yarn workspace @standardnotes/analytics worker",
"start:revisions": "yarn workspace @standardnotes/revisions-server start",
"start:revisions-worker": "yarn workspace @standardnotes/revisions-server worker",
"wait-for:db": "docker/wait-for.sh $DB_HOST $DB_PORT",
"wait-for:cache": "docker/wait-for.sh $REDIS_HOST $REDIS_PORT",
"wait-for:infra": "yarn wait-for:db && yarn wait-for:cache",
"wait-for:syncing-server": "docker/wait-for.sh localhost $SYNCING_SERVER_PORT",
"wait-for:auth": "docker/wait-for.sh localhost $AUTH_SERVER_PORT",
"wait-for:files": "docker/wait-for.sh localhost $FILES_SERVER_PORT",
"wait-for:revisions": "docker/wait-for.sh localhost $REVISIONS_SERVER_PORT",
"supervisor:start:syncing-server": "yarn wait-for:infra && yarn start:syncing-server",
"supervisor:start:syncing-server-worker": "yarn wait-for:syncing-server && yarn start:syncing-server-worker",
"supervisor:start:auth": "yarn wait-for:syncing-server && yarn start:auth",
"supervisor:start:auth-worker": "yarn wait-for:auth && yarn start:auth-worker",
"supervisor:start:files": "yarn wait-for:auth && yarn start:files",
"supervisor:start:files-worker": "yarn wait-for:files && yarn start:files-worker",
"supervisor:start:revisions": "yarn wait-for:files && yarn start:revisions",
"supervisor:start:revisions-worker": "yarn wait-for:revisions && yarn start:revisions-worker",
"supervisor:start:api-gateway": "yarn wait-for:revisions && yarn start:api-gateway",
"release": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"",
"publish": "lerna publish from-git --yes --no-verify-access --loglevel verbose",
"postversion": "./scripts/push-tags-one-by-one.sh",