June 20-22 Announcing HashiConf Europe full schedule: keynotes, sessions, labs & more Register Now
  • Infrastructure
    • terraform
    • packer
  • Networking
    • consul
  • Security
    • vault
    • boundary
  • Applications
    • nomad
    • waypoint
    • vagrant
  • HashiCorp Cloud Platform

    A fully managed platform to automate infrastructure on any cloud with HashiCorp products.

    • consul
    • terraform
    • vault
    • packerbeta
    Visit cloud.hashicorp.com
  • Overview
  • Tutorials
  • Docs
  • CLI
  • Plugins
  • Community
GitHub
Download
    • v0.8.x (latest)
    • v0.7.x
    • v0.6.x
    • v0.5.x
    • v0.4.x
    • v0.3.x
    • v0.2.x
    • v0.1.x
    • Overview
      • Overview
      • Helm
      • Heroku, Vercel, etc.
      • Kubernetes
  • Getting Started
    • Overview
    • Compatibility Promise
    • Protocol Version Table
    • Release Notifications
      • Overview
      • Upgrade to 0.2.0

    • Install
    • Externally Built Images
    • Building Container Images
    • Helm Deployment
    • YAML-Free Deployment
    • YAML Directory Deployment
    • Resource Status
    • ConfigMaps and Secrets

    • Overview
    • Git Integration
    • Remote Operations
    • Overview
    • Build
    • Deploy
    • Release
    • Hooks
    • Labels
    • Workspace and Label Scoping
    • Overview
      • Overview
      • Input Variables
      • External Data
      • artifact
      • deploy
      • entrypoint
      • labels
      • path
      • workspace
      • Overview
      • Full Reference
      • Templating
      • Overview
      • Expressions
      • JSON Syntax
    • app
    • build
    • config
    • deploy
    • hook
    • plugin
    • registry
    • release
    • runner
    • url
    • use
    • variable
  • URL Service
  • Logs
  • Exec
    • Overview
    • Dynamic Values
    • Files
    • Internal Values
    • Workspace and Label Scoping
    • Overview
      • Overview
      • OIDC
      • Overview
      • Maintenance
      • Production
      • Security
    • Express Server Install
    • Overview
    • Configuration
    • Profiles
    • On-Demand Runner
    • Additional Runners
  • Workspaces
  • Plugins
  • Triggers

    • Overview
      • Overview
      • Registering Plugin Components
      • Handling Configuration
      • Implementing the Builder Interface
      • Compiling the Plugin
      • Creating an Example Application
      • Testing the Plugin
    • Initializing the SDK
    • Passing Values Between Components
      • Overview
      • Authenticator
      • Configurable
      • ConfigurableNotify
      • Builder
      • Registry
      • Platform
      • ReleaseManager
      • Destroy
      • Status
      • Default Parameters
      • Overview
    • Overview
    • Disable
    • Overview
    • GitHub Actions
    • GitLab CI/CD
    • CircleCI
    • Jenkins
  • Troubleshooting
  • Glossary

    • Overview
    • Architecture
    • Operation Execution
  • Roadmap
Type '/' to Search

»Compiling the plugin

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:

PLUGIN_NAME=template

all: protos build

protos:
    @echo ""
    @echo "Build Protos"

  protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto
  protoc -I . --go_out=plugins=grpc:registry --go_opt=paths=source_relative ./registry/output.proto
  protoc -I . --go_out=plugins=grpc:platform --go_opt=paths=source_relative ./platform/output.proto
  protoc -I . --go_out=plugins=grpc:release --go_opt=paths=source_relative ./release/output.proto

build:
    @echo ""
    @echo "Compile Plugin"

    go build -o ./bin/waypoint-plugin-${PLUGIN_NAME} ./main.go

# Install the plugin locally
install:
    @echo ""
    @echo "Installing Plugin"

    cp ./bin/waypoint-plugin-${PLUGIN_NAME}* ${HOME}/.config/waypoint/plugins/
PLUGIN_NAME=template

all: protos build

protos:
    @echo ""
    @echo "Build Protos"

  protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto
  protoc -I . --go_out=plugins=grpc:registry --go_opt=paths=source_relative ./registry/output.proto
  protoc -I . --go_out=plugins=grpc:platform --go_opt=paths=source_relative ./platform/output.proto
  protoc -I . --go_out=plugins=grpc:release --go_opt=paths=source_relative ./release/output.proto

build:
    @echo ""
    @echo "Compile Plugin"

    go build -o ./bin/waypoint-plugin-${PLUGIN_NAME} ./main.go

# Install the plugin locally
install:
    @echo ""
    @echo "Installing Plugin"

    cp ./bin/waypoint-plugin-${PLUGIN_NAME}* ${HOME}/.config/waypoint/plugins/

Let's modify it a little. Edit the Makefile and change the PLUGIN_NAME to your plugin name gobuilder

PLUGIN_NAME=gobuilder
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.

  protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto
  protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto

Your Makefile should now look like:

PLUGIN_NAME=gobuilder

all: protos build

protos:
    @echo ""
    @echo "Build Protos"

  protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto

build:
    @echo ""
    @echo "Compile Plugin"

    go build -o ./bin/waypoint-plugin-${PLUGIN_NAME} ./main.go
PLUGIN_NAME=gobuilder

all: protos build

protos:
    @echo ""
    @echo "Build Protos"

  protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto

build:
    @echo ""
    @echo "Compile Plugin"

    go build -o ./bin/waypoint-plugin-${PLUGIN_NAME} ./main.go

With the Makefile changed, you can now run make to build the plugin.

make

Build Protos

protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto

Compile Plugin
go build -o ./bin/waypoint-plugin-gobuilder ./main.go
make

Build Protos

protoc -I . --go_out=plugins=grpc:builder --go_opt=paths=source_relative ./builder/output.proto

Compile Plugin
go build -o ./bin/waypoint-plugin-gobuilder ./main.go

If you look in the ./bin folder, you will see your compile plugin.

ls ./bin
waypoint-plugin-gobuilder
ls ./bin
waypoint-plugin-gobuilder

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.

➜ make install

Installing Plugin
cp ./bin/waypoint-plugin-gobuilder /home/nicj/.config/waypoint/plugins/
➜ make install

Installing Plugin
cp ./bin/waypoint-plugin-gobuilder /home/nicj/.config/waypoint/plugins/

Now the plugin has been installed, let's create an example application which uses your new plugin.

Next - Creating an Example Application

github logoEdit this page

Using Waypoint

The best way to understand what Waypoint can enable for your projects is to give it a try.

Waypoint tutorials
Waypoint documentation
Tutorial

Get Started - Kubernetes

Build, deploy, and release applications to a Kubernetes cluster.

View
Tutorial

Introduction to Waypoint

Waypoint enables you to publish any application to any platform with a single file and a single command.

View

Waypoint is maintained by HashiCorp, Inc.

View Code of Conduct
DocumentationCLI ReferenceTutorialsIntegrations
All systems normal