example-application
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.
Creating an Example Application
Video tutorial below:
Create a new folder called example_app
in your $HOME
folder; there is no restriction on the location of Waypoint apps,
$HOME
is just used for the guide.
If you look at the following example configuration, you will see that the use
block for the build
has a value
gobuilder
, which is the plugin's name to be loaded for the build component. Waypoint defines the convention that
plugins are always called waypoint-plugin-<name>
. When you run the waypoint build
command, Waypoint will search the
known plugin folders for a file called waypoint-plugin-gobuilder
it will then use that plugin for the build
component.
The configuration also has the values app
for the output_name
and the source as ./
, we can put our Go application
in the same location as the plugin config. First, create a file waypoint.hcl
in the folder $HOME/example_app/
with
the following contents.
Now you can create the source for the example application, let's make the most simple Go application possible. Create a
new file main.go
in your Waypoint application folder and copy the following to it.
You should now have two files in your application folder waypoint.hcl
and main.go
, let's test your new plugin.