Makefile target to build a single plugin for local testing.

Often when developing a plugin it's only necessary to rebuild that plugin.
Here we add a simple Makefile target that makes that easy:

    make plugin-dev PLUGIN=provider-aws

Since it's only building one package and it's only building for the
host architecture, this just uses "go install" directly, rather than using
gox as we do when installing multiple packages, possibly for multiple
architectures.
This commit is contained in:
Martin Atkins 2015-10-11 14:24:23 -07:00
parent 719e8c956e
commit 3af5552b54
2 changed files with 7 additions and 0 deletions

View File

@ -71,6 +71,7 @@ BUG FIXES:
INTERNAL IMPROVEMENTS: INTERNAL IMPROVEMENTS:
* core: Makefile target "plugin-dev" for building just one plugin. [GH-3229]
* helper/schema: Don't allow ``Update`` func if no attributes can actually be updated, per schema. [GH-3288] * helper/schema: Don't allow ``Update`` func if no attributes can actually be updated, per schema. [GH-3288]
* helper/schema: Default hashing function for sets [GH-3018] * helper/schema: Default hashing function for sets [GH-3018]
* helper/multierror: Remove in favor of [github.com/hashicorp/go-multierror](http://github.com/hashicorp/go-multierror). [GH-3336] * helper/multierror: Remove in favor of [github.com/hashicorp/go-multierror](http://github.com/hashicorp/go-multierror). [GH-3336]

View File

@ -15,6 +15,12 @@ dev: generate
quickdev: generate quickdev: generate
@TF_QUICKDEV=1 TF_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" @TF_QUICKDEV=1 TF_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'"
# Shorthand for building and installing just one plugin for local testing.
# Run as (for example): make plugin-dev PLUGIN=provider-aws
plugin-dev: generate
go install github.com/hashicorp/terraform/builtin/bins/$(PLUGIN)
mv $(GOPATH)/bin/$(PLUGIN) $(GOPATH)/bin/terraform-$(PLUGIN)
release: updatedeps release: updatedeps
gox -build-toolchain gox -build-toolchain
@$(MAKE) bin @$(MAKE) bin