Closed literarymachine closed 3 years ago
@dr0i please deploy on test.
Deployed to test.
Note to self:
npm test
fails because the port from .env
is used (which is the same port used for the productive service running there). So change that .env
-port temporarily for the sake of test.
npm test
did fail with:
✕ Should process a correct hook and create the files for a build (40030ms) ... ● processWebhooks › Should process a correct hook and create the files for a build expect(received).toBe(expected) // Object.is equality Expected: 0 Received: 1 111 | const dataDirContent = (await fs.readdir('data')) 112 | .filter(filename => filename !== '.gitignore') 113 | expect(dataDirContent.length).toBe(0)
Then I removed all files in test/data
and did git checkout -- test/data/
and then npm test
did succeed.
I compared the test/data
before and after the removing of the files there - but there was no difference. Weird.
I am not "that fluent" in javascript to say the least, so I cannot review properly.
But let me ask some conceptual question: it's not needed to trigger the gatsby build with npm run build
when w have the webhook running, right? Because the latter would trigger the build of the vocabularies and expose these, right? (if that`s true I would note this in the README).
Re "super strange weird test/data": just read the README to do a "rm -rf .cache
after changes in data/
which may also be true for test/data/
and which would explain the weirdness.
Redeployed. Note that, although the daemon comes up, an error message appeared in the logs:
npm ERR! code ELIFECYCLE
This error vanished when doing echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
.
It seems similar too https://github.com/skohub-io/skohub-vocabs/issues/104 . Although I am not aware of the effects of this npm ERR
I will add the fixes as hints into the README.
Opened https://github.com/skohub-io/skohub-vocabs/issues/112 for this.
Redeployed. Note that, although the daemon comes up, an error message appeared in the logs:
npm ERR! code ELIFECYCLE
I think this is the same error as in https://github.com/skohub-io/skohub-vocabs/issues/79#issuecomment-738652600
Correction:
although a tail -f logs/skohub-vocabs.log
didn't reveal the mentioned npm ERR
a cat
on the log shows that it's still there, so the "fix" using max_user_watches
didn't help. Also npm cache clean --force; rm -rf node_modules package-lock.json
didn't help.
As the daemon (that's the webhookserver
) shows up we might ignore this.
But there are other problems showing in the log, which I only experience on test
:
UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/lod/git/skohub-vocabs/src/../public/' at Object.statSync (fs.js:932:3) at Object.statSync (/home/lod/git/skohub-vocabs/node_modules/graceful-fs/polyfills.js:307:34)
The public
directory indeed does not exist, but then it also doesn't exist on production
.
It should be created when npm run build
is done to Run the static site generator
, but that's not done in scripts/start.sh
.
I am a bit in the dark here maybe you can brighten this up a bit @literarymachine ?
The current status is that it says the build is triggered but the build page is empty, see https://test.skohub.io/build/?id=93625061-84f5-4182-8f8a-677209bcce4e
I think this is the same error as in #79 (comment)
no, this ERR is showing always up when starting via the start script:
npm ERR! code ELIFECYCLE npm ERR! errno 143 npm ERR! gatsby-starter-default@0.1.0 listen:
node src/webHookServer.js
npm ERR! Exit status 143 npm ERR!· npm ERR! Failed at the gatsby-starter-default@0.1.0 listen script.
I wil at least note this at the server to not forget to just ignore this.
@dr0i, please redeploy to test once again.
Redeployed.
Looks good now from a functional perspective. Please add code review and deploy to production.
I am not "that fluent" in javascript to say the least, so I cannot review properly.
If this is ok, though, I can deploy it anyway.
@fsteeg, do you want to take a look? Otherwise I am ok with deploying it directly.
Please deploy, then, @dr0i .
Deployed to production, closed.
Fixes #79