Separate compiled App from CLI tooling #129
Replies: 6 comments 11 replies
-
I am not fully sure. My understanding is that, finally, we can build the application by just running |
Beta Was this translation helpful? Give feedback.
-
While thinking about this one I thought we could change this "TransformMain" strategy to be an API that could be used in |
Beta Was this translation helpful? Give feedback.
-
Well, in my opinion the main issue is the fact we rewrite the main to include migrations stuff. How about just generating the app the same way as now, but with the code we inject in main as part of the user app? |
Beta Was this translation helpful? Give feedback.
-
@paganotoni: I still think we should go with an approach similar to gobuffalo/buffalo#1791 A sample application with the proposed new layout would already be available here: https://github.com/markbates/bluffalo Specifically this is the This is the It has 2 exported functions: |
Beta Was this translation helpful? Give feedback.
-
It seems like the "moving
Also, having apps in For the end-users, I think the simple structure with a single binary (command) for all they need to do for their service management is one of the best parts of using buffalo, also this change requires them to migrate their management(deployment) pipeline. If we don't have a solid consensus on this approach yet, I would like to keep the original structure at least for now. Also, I would like to freeze the current version of buffalo (except for fixing broken things) as v1 (yes, I want to make this version as v1 to prevent confusion for existing users when we are going to the next version) soon and I hope we can implements any possible breaking changes on a new structure as v2. What do you think? @paganotoni @fasmat @stanislas-m |
Beta Was this translation helpful? Give feedback.
-
Hi folks! Re: structure, I poked around with it both ways and it seems fine either way, but did notice that For the "other commands" issue, I treat the buffalo binary as a general purpose command with a hacky init() in main.go that redirects all but certain arguments to a grift:
This lets A less hacky way to do this would be awesome, but this works for now. |
Beta Was this translation helpful? Give feedback.
-
Currently Buffalo build does some transformations to the main to embed other things within the resulting binary. Besides the application the compiled binary ends up having tasks and migrations making the build process tricky.
It seems to me that it is a common Go pattern to have multiple binaries within a codebase. Assuming that's the case we could split the CLI functionality into a separate
cmd/cli
.Implications
cmd
,cmd/app
andcmd/cli
.cmd/cli
and fixes the Dockerfile.transformMain
part of our build process and maybe move closer to the go build command.Thoughts on this? cc @stanislas-m @sio4 @fasmat @gobuffalo/all
Beta Was this translation helpful? Give feedback.
All reactions