riboseinc / jekyll-theme-open-project

Jekyll theme for site suite presenting your open software and specifications.
MIT License
30 stars 3 forks source link

Keep project data in dotfiles in corresponding project repos and pull it during site build #7

Closed strogonoff closed 5 years ago

strogonoff commented 6 years ago

Currently project data in YAML format must be included in project site source, and additionally duplicated in hub site source.

What we could instead do is the following approach:

Proper implementation here would likely also deal with #2 in one blow.

ronaldtse commented 6 years ago

Yes this works indeed. The only issue is that the hub pages need to be rebuilt whenever a project site gets updated, but that's a given due to the role of the hub pages.

strogonoff commented 6 years ago

@ronaldtse yeah, this implies some hook to trigger site suite to be rebuilt whenever .open-project.yml gets updated, and we would want to be more efficient and avoid rebuilding sites for projects which data was not modified.

Seems like it’s doable with CI: trigger project site build when a specified branch is updated, and trigger hub site build when that branch is updated in any of project repos. There may be a bit of duplication where we’ll have to link to same list of project source repos in (1) hub site Jekyll plugin configuration, and (2) hub site CI configuration, but that doesn’t seem especially dire.

ronaldtse commented 6 years ago

Yes, we can even just do git submodule of project sites within the hub site repo. And all we need is to update the config.yml file to include those posts (I think...).

strogonoff commented 6 years ago

I guess we have two options:

  1. Configure hub site with links to project repos, and let build process pull the data from those repos, possibly specific branches. (IMO instead of having an “open project site” repo for each project we could use a branch inside actual project codebase repos and keep the data there. Again, similar to one of approaches to GitHub Pages setup.)
  2. Submodule project site data. I’m not sure if we’ll be able to submodule a specific branch (it seems a bit messy), but it’s an option.

I prefer the first one for now.

strogonoff commented 6 years ago

And all we need is to update the config.yml file to include those posts (I think...).

It’s currently a bit more complicated but yeah, the current end idea is that we’d just configure a list of projects in _config.yml and let jekyll build pull data for those projects, possibly with local caching. That way project data exists in one place, and thanks to commonly used design pattern (a dotfile in repo root) it’d be easy to understand the setup.

Edit: submodules eliminate the need for local caching, on flip side they add complexity to the setup but if that only affects the hub site it may be acceptable.

strogonoff commented 5 years ago

This is implemented as of 1.0.0. Current implementation does not involve dotfile per se, but works similarly.

Below is an illustration of how it works given one hub, one project, and one software and spec (with the caveat that spec fetching currently is not used for any specific feature).

illustrations

ronaldtse commented 5 years ago

@strogonoff thanks for the beautiful diagram 😉

One note that if you have time can you go through our list of repos -- many things (i.e. new/renamed repos) have updated since we first started. Thanks!