Compiling the plugin
Warning
This content is part of the legacy version of Waypoint that is no longer actively maintained. For additional information on the new vision of Waypoint, check out this blog post and the HCP Waypoint documentation.
Video tutorial below:
To compile the plugin, you can use the Makefile
that the template generated for you. The contents of this file look like:
Let's modify it a little. Edit the Makefile
and change the PLUGIN_NAME
to your plugin name gobuilder
By default, the templated plugin will generate the Go code for all the different components, since your plugin only
implements the Builder
component, you can remove all the other protoc
commands.
Your Makefile
should now look like:
With the Makefile
changed, you can now run make
to build the plugin.
If you look in the ./bin folder, you will see your compile plugin.
Let's now install the plugin so that it can be used by the Waypoint CLI.
Installing the plugin
You can install your plugin using the make install
command. Waypoint will automatically
load plugins from certain know locations, these are:
- Same directory as any
waypoint.hcl
- <waypoint_app_folder>/.waypoint/plugins/
- \$XDG_CONFIG_HOME/waypoint/plugins/
The make install
command will copy the plugin to the Waypoint config in your
$HOME
folder. Note that this may not match your $XDG_CONFIG_HOME
value so
please double check this is correct for you.
Now the plugin has been installed, let's create an example application which uses your new plugin.