How to use plugins while building the binary? #3701
-
Hey there! We have a repo where we are using multiple plugins that we compile into the final archive during the build. We use a makefile to build all the plugins and then we build the final binary which then uses these plugins when it runs. I looked through One possible solution at the top of my mind is using multiple builders for each plugin, however I am not sure if that is an efficient way of doing it. Is there a better approach that I was unable to find in the docs? Can anyone point me in the right direction of how I can support plugins being built? For instance, this is the makefile we are using for building the plugins |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
by plugins you mean what exactly? glancing at the makefile, you seem to just build multiple binaries which are elasticsearch plugins? If so, you just need multiple builds:
- id: plugin1
main: .
ldflags: [etc]
- id: plugin2
main: .
ldflags: [etc] |
Beta Was this translation helpful? Give feedback.
-
I mean go plugins that can be built with the
I am trying this approach out to see if this works based on the requirements, I essentially want to dynamically build all the plugins in the |
Beta Was this translation helpful? Give feedback.
I mean go plugins that can be built with the
--buildmode=plugin
as stated here option and can later be used in the main go file using the path of the built plugins. I am not sure if they are binaries since the built plugins have a.so
extension.I am trying this approach out to see if this works based on the requirements, I essentially want to dynamically build all the plugins in the
plugins
directory.