Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into hashicorpGH-6076-aw…
Browse files Browse the repository at this point in the history
…s_route-changes

 Conflicts:
	builtin/providers/aws/resource_aws_route.go
  • Loading branch information
jrnt30 committed Jul 18, 2016
2 parents 640859f + d4e8616 commit 457993b
Show file tree
Hide file tree
Showing 1,583 changed files with 205,456 additions and 29,153 deletions.
240 changes: 239 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

1,477 changes: 0 additions & 1,477 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

25 changes: 15 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
TEST?=$$(go list ./... | grep -v /vendor/)
TEST?=$$(go list ./... | grep -v '/terraform/vendor/' | grep -v '/builtin/bins/')
VETARGS?=-all
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)

default: test vet

tools:
go get -u github.com/kardianos/govendor
go get -u golang.org/x/tools/cmd/stringer
go get -u golang.org/x/tools/cmd/cover

# bin generates the releaseable binaries for Terraform
bin: fmtcheck generate
@TF_RELEASE=1 sh -c "'$(CURDIR)/scripts/build.sh'"
Expand All @@ -19,15 +25,16 @@ quickdev: generate
# changes will require a rebuild of everything, in which case the dev
# target should be used.
core-dev: generate
go install github.com/hashicorp/terraform
go install -tags 'core' github.com/hashicorp/terraform

# Shorthand for quickly testing the core of Terraform (i.e. "not providers")
core-test: generate
@echo "Testing core packages..." && go test $(shell go list ./... | grep -v -E 'builtin|vendor')
@echo "Testing core packages..." && \
go test -tags 'core' $(TESTARGS) $(shell go list ./... | grep -v -E 'terraform/(builtin|vendor)')

# Shorthand for building and installing just one plugin for local testing.
# Run as (for example): make plugin-dev PLUGIN=provider-aws
plugin-dev: fmtcheck generate
plugin-dev: generate
go install github.com/hashicorp/terraform/builtin/bins/$(PLUGIN)
mv $(GOPATH)/bin/$(PLUGIN) $(GOPATH)/bin/terraform-$(PLUGIN)

Expand Down Expand Up @@ -59,9 +66,6 @@ cover:
# vet runs the Go source code static analysis tool `vet` to find
# any common errors.
vet:
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
go get golang.org/x/tools/cmd/vet; \
fi
@echo "go tool vet $(VETARGS) ."
@go tool vet $(VETARGS) $$(ls -d */ | grep -v vendor) ; if [ $$? -eq 1 ]; then \
echo ""; \
Expand All @@ -76,12 +80,13 @@ generate:
@which stringer ; if [ $$? -ne 0 ]; then \
go get -u golang.org/x/tools/cmd/stringer; \
fi
go generate $$(go list ./... | grep -v /vendor/)
go generate $$(go list ./... | grep -v /terraform/vendor/)
@go fmt command/internal_plugin_list.go > /dev/null

fmt:
gofmt -w .
gofmt -w $(GOFMT_FILES)

fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"

.PHONY: bin default generate test updatedeps vet fmt fmtcheck
.PHONY: bin default generate test vet fmt fmtcheck tools
67 changes: 17 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,76 +69,43 @@ $ make core-dev

### Dependencies

Terraform stores its dependencies under `vendor/`, which [Go 1.6+ will automatically recognize and load](https://golang.org/cmd/go/#hdr-Vendor_Directories). We use [`godep`](https://github.com/tools/godep) to manage the vendored dependencies.

Generally speaking, `godep` operations follow this pattern:

1. Get current state of dependencies into your `$GOPATH` with `godep restore`.
2. Make changes to the packages in `$GOPATH`.
3. Tell `godep` to capture those changes in the Terraform repo.
Terraform stores its dependencies under `vendor/`, which [Go 1.6+ will automatically recognize and load](https://golang.org/cmd/go/#hdr-Vendor_Directories). We use [`govendor`](https://github.com/kardianos/govendor) to manage the vendored dependencies.

If you're developing Terraform, there are a few tasks you might need to perform.

#### Adding a dependency

If you're adding a dependency, you'll need to vendor it in the same Pull Request as the code that depends on it. You should do this in a separate commit from your code, as makes PR review easier and Git history simpler to read in the future.

Because godep captures new dependencies from the local `$GOPATH`, you first need to `godep restore` from the master branch to ensure that the only diff is your new dependency.
To add a dependency:

Assuming your work is on a branch called `my-feature-branch`, the steps look like this:

```bash
# Get latest master branch's dependencies staged in local $GOPATH
git checkout master
git pull
godep restore -v
1. Add the new package to your GOPATH:

# Capture the new dependency referenced from my-feature-branch
git checkout my-feature-branch
git rebase master
godep save ./...
```bash
go get github.com/hashicorp/my-project
```

# There should now be a diff in `vendor/` with added files for your dependency,
# and a diff in Godeps/Godeps.json with metadata for your dependency.
2. Add the new package to your vendor/ directory:

# Make a commit with your new dependencies added
git add -A
git commit -m "vendor: Capture new dependency upstream-pkg"
```bash
govendor add github.com/hashicorp/my-project/package
```

# Push to your branch (may need -f if you rebased)
git push origin my-feature-branch
```
3. Review the changes in git and commit them.

#### Updating a dependency

If you're updating an existing dependency, godep provides a specific command to snag the newer version from your `$GOPATH`.

```bash
# Get latest master branch's dependencies staged in local $GOPATH
git checkout master
git pull
godep restore -v
To update a dependency:

# Make your way to the dependency in question and checkout the target ref
pushd $GOPATH/src/github.com/some/dependency
git checkout v-1.next
1. Fetch the dependency:

# Head back to Terraform on a feature branch and update the dependncy to the
# version currently in your $GOPATH
popd
git checkout my-feature-branch
godep update github.com/some/dependency/...
```bash
govendor fetch github.com/hashicorp/my-project
```

# There should now be a diff in `vendor/` with changed files for your dependency,
# and a diff in Godeps/Godeps.json with metadata for the updated dependency.

# Make a commit with the updated dependency
git add -A
git commit -m "vendor: Update dependency upstream-pkg to 1.4.6"

# Push to your branch
git push origin my-feature-branch
```
2. Review the changes in git and commit them.

### Acceptance Tests

Expand Down
5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
v.memory = 4096
v.cpus = 2
end

config.vm.provider "parallels" do |prl|
prl.memory = 4096
prl.cpus = 2
end
end
1 change: 0 additions & 1 deletion builtin/bins/provider-aws/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-azure/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-clc/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-cloudflare/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-cloudstack/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-consul/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-datadog/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-digitalocean/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-dme/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-dnsimple/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-docker/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-dyn/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-fastly/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-github/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-google/main_test.go

This file was deleted.

12 changes: 12 additions & 0 deletions builtin/bins/provider-grafana/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"github.com/hashicorp/terraform/builtin/providers/grafana"
"github.com/hashicorp/terraform/plugin"
)

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: grafana.Provider,
})
}
1 change: 0 additions & 1 deletion builtin/bins/provider-heroku/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-influxdb/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-librato/main_test.go

This file was deleted.

12 changes: 12 additions & 0 deletions builtin/bins/provider-logentries/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"github.com/hashicorp/terraform/builtin/providers/logentries"
"github.com/hashicorp/terraform/plugin"
)

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: logentries.Provider,
})
}
File renamed without changes.
1 change: 0 additions & 1 deletion builtin/bins/provider-mailgun/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-mysql/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-null/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-postgresql/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-powerdns/main_test.go

This file was deleted.

15 changes: 15 additions & 0 deletions builtin/bins/provider-random/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

import (
"github.com/hashicorp/terraform/builtin/providers/random"
"github.com/hashicorp/terraform/plugin"
"github.com/hashicorp/terraform/terraform"
)

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: func() terraform.ResourceProvider {
return random.Provider()
},
})
}
12 changes: 12 additions & 0 deletions builtin/bins/provider-scaleway/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"github.com/hashicorp/terraform/builtin/providers/scaleway"
"github.com/hashicorp/terraform/plugin"
)

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: scaleway.Provider,
})
}
1 change: 0 additions & 1 deletion builtin/bins/provider-softlayer/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provider-terraform/main_test.go

This file was deleted.

15 changes: 15 additions & 0 deletions builtin/bins/provider-test/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

import (
"github.com/hashicorp/terraform/builtin/providers/test"
"github.com/hashicorp/terraform/plugin"
"github.com/hashicorp/terraform/terraform"
)

func main() {
plugin.Serve(&plugin.ServeOpts{
ProviderFunc: func() terraform.ResourceProvider {
return test.Provider()
},
})
}
1 change: 0 additions & 1 deletion builtin/bins/provider-vsphere/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provisioner-chef/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provisioner-file/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provisioner-local-exec/main_test.go

This file was deleted.

1 change: 0 additions & 1 deletion builtin/bins/provisioner-remote-exec/main_test.go

This file was deleted.

Loading

0 comments on commit 457993b

Please sign in to comment.