Closed avacariu closed 9 years ago
I just test it quickly and it seems to work well except that the README says to use the relative path to the domain dir:
CONFIG=domains/wikipediahistory/ make
CONFIG=domains/avherald/ make
whereas the makefile actually adds the domains/. I'd slightly favour having the makefile use $(CONFIG) directly since it's in keeping with $(SRC) and $(OUT).
Also, it might be good to take the Makefile.local thing from my mwhitneybackendmakefileproposal branch (for #176) even if we don't decide to use the other changes there. That way the domain can be set in Makefile.local, corresponding to the frontend domain setting in local_config.py.
I fixed the CONFIG
thing in the README. I prefer without the path since it's less typing and all domain-specific files should be in domains/
(and in git) so that when we build these automatically using Docker, you can quickly clone the repo and build a set of Docker images for a specific domain.
RE: Makefile.local
Do you have an example Makefile.local in that branch? I didn't see one in backend/
or domains/*/
. Is that file supposed to just set some environment variables and then run the main Makefile?
I didn't have any example, but it would get sourced by the makefile and could change either the paths that are defined in Makefile or standard system paths like PATH and LD_LIBRARY_PATH. So if a user wants to save their local setup they use Makefile.local, and since that file isn't in the repository it's harder to accidentally commit local settings. Similar to local_config.py on the frontend.
The change is just to add "-include Makefile.local" after the SRC, CONFIG, OUT definitions, plus a line of documentation somewhere.
Also, the top level README and the top part of website.md ("Choose a domain") still refer to domains/.
As long as you can still pass it those definitions as environment variables, then I think the Makefile.local is a good idea.
Yes, but in that case the "-include Makefile.local" should be before the variables, and anything in Makefile.local that might need to be overridden by the environment should be defined with ?= instead of =.
I just pushed my suggestion to move-backend-domains-local.
I think the suggestion's going to work well. I merged your commits into move-backend-domains
.
There are a few things I changed here:
domains/
intobackend/domains/
backend/domains
/CONFIG
environment variable to select which domain you want to build files for.backend/
source files intobackend/src/
to clean upbackend/
and make it more clear which files you should be running after you runmake
(you should run the files inbackend/build/
)All these are in the commit messages below, but I thought I'd write a nice list.
I've tested that the backend still works the same as before (and it does), but as always, I'd appreciate if someone else could confirm.