eclipse-openj9 / openj9-website

openj9-website
24 stars 28 forks source link

Preserve the docs directory, if it exists, when publishing website #333

Closed pshipton closed 1 year ago

pshipton commented 1 year ago

Related to https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1849

pshipton commented 1 year ago

I haven't directly tried this yet.

AdamBrousseau commented 1 year ago

Should we get a review from @doveye as well?

pshipton commented 1 year ago

Once https://github.com/eclipse-openj9/openj9-website/pull/332 is merged, and we get the UNB machines back, I'll be trying this out.

doveye commented 1 year ago

Not sure I understand the purpose of this change - is it that the publishing of the website wipes the user doc output that came from the openj9-docs build, so we need to do something to preserve the latter? If so, does there need to be a git commit too? Should || be something else? (I gather from looking online that the command to the right of || is run only if the command to the left of || fails.)

pshipton commented 1 year ago

is it that the publishing of the website wipes the user doc output that came from the openj9-docs build, so we need to do something to preserve the latter?

Correct.

does there need to be a git commit too

The gh-pages command does that.

Should || be something else? (I gather from looking online that the command to the right of || is run only if the command to the left of || fails.)

Seems like it. I haven't fully tested this yet. I'll figure out how to correct it.

pshipton commented 1 year ago

It seems there are two websites. One for the main website and one for docs. I've decided to put the docs content into the docs branch of https://github.com/eclipse-openj9/openj9-website-publish since they don't need to be in the same place. That makes this change obsolete.

https://github.com/eclipse-openj9/openj9-website-publish/tree/docs

doveye commented 1 year ago

Yes, there's the Gatsby stuff for the main website and the MkDocs hosting environment for the user docs. Thanks for sorting them out :)

pshipton commented 1 year ago

According to https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1849#note_1068739 we can't have two branches so we'll need this after all. I still need to test it.

doveye commented 1 year ago

Could we put the website output in one subdirectory and the docs output in another? Then maybe the website publish process will only wipe the relevant subdir and leave the docs subdir alone?

pshipton commented 1 year ago

The git commit doesn't work that way. You need to have the full content when committing. Which is what this change is doing, adding in the docs directory. Otherwise the git commit will remove it, which is the behaviour we have now. I don't think there is any advantage in moving the website content to a directory, it's already working as-is with the Eclipse publishing tool. I'm not sure it would work if we moved it, and may break the link from the website to the docs.

I've made a fix and this change is now tested and working. I published my website branch used for this PR to the website-publish test branch https://openj9-jenkins.osuosl.org/view/Website-Doc/job/Deploy-OpenJ9-Website/34 https://github.com/eclipse-openj9/openj9-website-publish/tree/test

You can see the docs directory was preserved. It updated the website and removed the aarch64 update, since this change isn't part of my branch. https://github.com/eclipse-openj9/openj9-website-publish/compare/main...test

After this PR is merged I'll delete the website-publish test branch and restore the configuration of https://openj9-jenkins.osuosl.org/view/Website-Doc/job/Deploy-OpenJ9-Website to use the website repo and branch instead of my fork.