Browse Source

chore: switch to node pnp initializing

Karol Sójko 2 năm trước cách đây
mục cha
commit
12d9ccf28c

+ 19 - 19
docker/supervisord.conf

@@ -1,74 +1,74 @@
 [supervisord]
 nodaemon=true
-logfile=/tmp/supervisord.log
+logfile=/var/lib/server/logs/supervisord.log
 
 [program:syncing-server]
-directory=/opt/bundled/syncing-server
-command=yarn workspace @standardnotes/syncing-server supervisor:start
+directory=/opt/bundled/syncing-server/packages/syncing-server
+command=/opt/bundled/syncing-server/packages/syncing-server/supervisor/supervisor-server.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/syncing-server.log
 stderr_logfile=/var/lib/server/logs/syncing-server.err
 
 [program:syncing-server-worker]
-directory=/opt/bundled/syncing-server
-command=yarn workspace @standardnotes/syncing-server supervisor:worker
+directory=/opt/bundled/syncing-server/packages/syncing-server
+command=/opt/bundled/syncing-server/packages/syncing-server/supervisor/supervisor-worker.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/syncing-server-worker.log
 stderr_logfile=/var/lib/server/logs/syncing-server-worker.err
 
 [program:auth]
-directory=/opt/bundled/auth
-command=yarn workspace @standardnotes/auth-server supervisor:start
+directory=/opt/bundled/auth/packages/auth
+command=/opt/bundled/auth/packages/auth/supervisor/supervisor-server.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/auth.log
 stderr_logfile=/var/lib/server/logs/auth.err
 
 [program:auth-worker]
-directory=/opt/bundled/auth
-command=yarn workspace @standardnotes/auth-server supervisor:worker
+directory=/opt/bundled/auth/packages/auth
+command=/opt/bundled/auth/packages/auth/supervisor/supervisor-worker.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/auth-worker.log
 stderr_logfile=/var/lib/server/logs/auth-worker.err
 
 [program:files]
-directory=/opt/bundled/files
-command=yarn workspace @standardnotes/files-server supervisor:start
+directory=/opt/bundled/files/packages/files
+command=/opt/bundled/files/packages/files/supervisor/supervisor-server.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/files.log
 stderr_logfile=/var/lib/server/logs/files.err
 
 [program:files-worker]
-directory=/opt/bundled/files
-command=yarn workspace @standardnotes/files-server supervisor:worker
+directory=/opt/bundled/files/packages/files
+command=/opt/bundled/files/packages/files/supervisor/supervisor-worker.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/files-worker.log
 stderr_logfile=/var/lib/server/logs/files-worker.err
 
 [program:revisions]
-directory=/opt/bundled/revisions
-command=yarn workspace @standardnotes/revisions-server supervisor:start
+directory=/opt/bundled/revisions/packages/revisions
+command=/opt/bundled/revisions/packages/revisions/supervisor/supervisor-server.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/revisions.log
 stderr_logfile=/var/lib/server/logs/revisions.err
 
 [program:revisions-worker]
-directory=/opt/bundled/revisions
-command=yarn workspace @standardnotes/revisions-server supervisor:worker
+directory=/opt/bundled/revisions/packages/revisions
+command=/opt/bundled/revisions/packages/revisions/supervisor/supervisor-worker.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/revisions-worker.log
 stderr_logfile=/var/lib/server/logs/revisions-worker.err
 
 [program:api-gateway]
-directory=/opt/bundled/api-gateway
-command=yarn workspace @standardnotes/api-gateway supervisor:start
+directory=/opt/bundled/api-gateway/packages/api-gateway
+command=/opt/bundled/api-gateway/packages/api-gateway/supervisor/supervisor-server.sh
 autostart=true
 autorestart=true
 stdout_logfile=/var/lib/server/logs/api-gateway.log

+ 11 - 0
packages/api-gateway/supervisor/entrypoint-server.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/server.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 6 - 0
packages/api-gateway/supervisor/supervisor-server.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh localhost $SYNCING_SERVER_PORT
+node supervisor/entrypoint-server.js

+ 0 - 0
packages/api-gateway/docker/wait-for.sh → packages/api-gateway/supervisor/wait-for.sh


+ 11 - 0
packages/auth/supervisor/entrypoint-server.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/server.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 11 - 0
packages/auth/supervisor/entrypoint-worker.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/worker.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 6 - 0
packages/auth/supervisor/supervisor-server.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh localhost $SYNCING_SERVER_PORT
+node supervisor/entrypoint-server.js

+ 6 - 0
packages/auth/supervisor/supervisor-worker.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh localhost $AUTH_SERVER_PORT
+node supervisor/entrypoint-worker.js

+ 0 - 0
packages/auth/docker/wait-for.sh → packages/auth/supervisor/wait-for.sh


+ 11 - 0
packages/files/supervisor/entrypoint-server.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/server.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 11 - 0
packages/files/supervisor/entrypoint-worker.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/worker.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 7 - 0
packages/files/supervisor/supervisor-server.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh $DB_HOST $DB_PORT
+sh supervisor/wait-for.sh $REDIS_HOST $REDIS_PORT
+node supervisor/entrypoint-server.js

+ 6 - 0
packages/files/supervisor/supervisor-worker.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh localhost $SYNCING_SERVER_PORT
+node supervisor/entrypoint-worker.js

+ 0 - 0
packages/files/docker/wait-for.sh → packages/files/supervisor/wait-for.sh


+ 11 - 0
packages/revisions/supervisor/entrypoint-server.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/server.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 11 - 0
packages/revisions/supervisor/entrypoint-worker.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/worker.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 7 - 0
packages/revisions/supervisor/supervisor-server.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh $DB_HOST $DB_PORT
+sh supervisor/wait-for.sh $REDIS_HOST $REDIS_PORT
+node supervisor/entrypoint-server.js

+ 6 - 0
packages/revisions/supervisor/supervisor-worker.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh localhost $SYNCING_SERVER_PORT
+node supervisor/entrypoint-worker.js

+ 0 - 0
packages/revisions/docker/wait-for.sh → packages/revisions/supervisor/wait-for.sh


+ 11 - 0
packages/syncing-server/supervisor/entrypoint-server.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/server.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 11 - 0
packages/syncing-server/supervisor/entrypoint-worker.js

@@ -0,0 +1,11 @@
+'use strict'
+
+const path = require('path')
+
+const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
+
+const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/worker.js')))
+
+Object.defineProperty(exports, '__esModule', { value: true })
+
+exports.default = index

+ 7 - 0
packages/syncing-server/supervisor/supervisor-server.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh $DB_HOST $DB_PORT
+sh supervisor/wait-for.sh $REDIS_HOST $REDIS_PORT
+node supervisor/entrypoint-server.js

+ 6 - 0
packages/syncing-server/supervisor/supervisor-worker.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -euo pipefail
+
+sh supervisor/wait-for.sh localhost $SYNCING_SERVER_PORT
+node supervisor/entrypoint-worker.js

+ 0 - 0
packages/syncing-server/docker/wait-for.sh → packages/syncing-server/supervisor/wait-for.sh