Open ivanminutillo opened 3 weeks ago
Hey! I wrote that comment. I was very interested in learning what the Justfile does and sharing some of my notes in case its useful.
I am new to Just. So I needed to understand the following :
init services="db": _pre-init
The recipe name is init. It is passed a parameter services with default value db
. Recipe named _pre-init
is run before initI also tried to create a rough dependency graph of the setup-dev recipe.
flowchart TD
setupDev(setup-dev) --> buildNode(build)
subgraph Build Docker Image. Copy Code from Extensions and current flavour to Main project
assetsLn(
_assets-ln:
Creates a symbolic link to
extensions/bonfire_ui_common/assets
in the current working directory
)
preInit(
_pre-init:
Make data directory
Make priv/repo directory
Copy files from FLAVOUR_PATH/repo into ./priv/repo
Delete ./data/current_flavour
Make a symbolic link from ../$FLAVOUR_PATH to ./data/current_flavour
Make priv/static/public directory
)
init(
init:
)
buildNode(
build : Build the docker image
Make deps directory
Build docker image based on WITH_DOCKER value
)
services(
services : Start background docker services eg. db and search backends.
based on MIX_ENV, Start background docker services.
eg. db and search backends.
)
servicesCondition{
MIX_ENV == 'prod'
}
relServices(
rel-services
Start release related docker services
)
devServices(
dev-services
Start dev related docker services
)
assetsLn --> preInit --> init --> buildNode
init --> services --> servicesCondition
servicesCondition --YES--> relServices
servicesCondition --NO--> devServices
end
From reading the documentation and the justfile, what I have gathered so far is setup-dev
does the following :
From the graph, I can point out some issues that I think will stump newbies.
I understand that refactoring the Justfile is not a priority at this point so maybe a better approach could be to solve it in the documentation. Maybe we can write a high level description of the various things that need to happen in order for bonfire to start and which recipes are involved in doing what. I have also noticed some naming convention in the recipes that indicate a certain grouping, like prefixing the recipe names with rel-
, deps-
, update-
etc. So if there is a logical grouping already, explaining that to newbies might help demistify this more.
this is great! thanks a lot! We've setup a matrix room to coordinate around documentation and Q&A, if you're interested in joining https://matrix.to/#/#bonfire-documentation:matrix.org
From this elixir thread
"I think the decision to use just as the build tool and having the various components be split in different repos that are then pulled in when setting the dev environment, add to the learning curve to get onboarded. I am guessing when things work this wouldn’t be a problem. In my case it didnt work right away and when I started debugging, that’s when I realized how the project is structured in an unusual way compared to other elixir projects.
Maybe a high level overview of the build process and what all happens when one runs the just config or just setup commands could help simplify things 😃 "