openhab / website

This repository contains the final artifacts from which the project website is served.
https://www.openhab.org/
20 stars 47 forks source link

Local build of webpage does not work on Ubuntu 22.04.4 LTS x86_64 #454

Closed pgfeller closed 4 months ago

pgfeller commented 4 months ago

Fixes #452

This fix allows to build the website completely locally and makes the process much easier for contributors to verify their changes locally.

📦 package.json

stefan-hoehn commented 4 months ago

Patrik, is there a way I can test it? It least the preview tells us that it least did not break anything on our platform ;-) I would just dare to merge it, WDYT?

pgfeller commented 4 months ago

I would just dare to merge it, WDYT?

@stefan-hoehn:

Well - the change in package.json that controls build should not be affect productive mode (dev/local only). The other thing that changed is .gitignore - but here as well I do not expect a problem ➡️ in my opinion we should try the merge - but be prepared for an immediate rollback in case of a problem. I expect that a failed build would persist the build logs - so that I/we could analyze what caused the issue & how we can prevent that problem in the future.

stefan-hoehn commented 4 months ago

Ok, then I will merge. Please @pgfeller have a look at it as well if it went well.

pgfeller commented 4 months ago

Patrik, is there a way I can test it?

@stefan-hoehn

I do not know how close the apple os is to linux - maybe you can test the local dev build on your machine. But I'm not sure that the productive build will use the exact same mechanism (actually I'm sure it does not - but probably the PR check does). So I recommendation remains the same - we should give it a try. But it would also be interesting if the modified dev build scripts make the life easier on the mac platform.

stefan-hoehn commented 4 months ago

FYI I edited and added a few things. You may want to review this.

I tried running it (in the root folder of the project) but it fails pretty fast:

openhab-website % npm run build-local-latest -y

> openhab-website@3.0.0 build-local-latest
> OH_DOCS_VERSION=final npm run build-local

> openhab-website@3.0.0 build-local
> rm javadoc-*.tgz* -f && npm run prepare-docs && npm run dev

rm: javadoc-*.tgz*: No such file or directory
rm: -f: No such file or directory
pgfeller commented 4 months ago

openhab-website@3.0.0 build-local rm javadoc-.tgz -f && npm run prepare-docs && npm run dev rm: javadoc-.tgz: No such file or directory rm: -f: No such file or directory

This should delete "old" download tar balls from previous build - but if there was no previous build and the temp files are not present rm seems to fail. That can probably be solved with a parameter for the rmcommand. Shall I have a look - or do you have time to try it locally and commit the change directly?

stefan-hoehn commented 4 months ago

No, I don't have the time. I would appreciate if you had the chance to look into it 🙏🏻

stefan-hoehn commented 4 months ago

Tested together with @pgfeller and looks awesome.

Very nice contribution, <3 !