Skip to content

Commit 3ff9222

Browse files
author
Lee Johnson
committed
Merge remote-tracking branch 'origin/master' into statuscake_adding_contact_group
2 parents 3e4f797 + 77325d9 commit 3ff9222

3,612 files changed

Lines changed: 567851 additions & 79349 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ to a single resource. Most tests follow a similar structure.
373373

374374
1. Pre-flight checks are made to ensure that sufficient provider configuration
375375
is available to be able to proceed - for example in an acceptance test
376-
targetting AWS, `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY` must be set prior
376+
targetting AWS, `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` must be set prior
377377
to running acceptance tests. This is common to all tests exercising a single
378378
provider.
379379

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: false
22
language: go
33
go:
4-
- 1.6
4+
- 1.7.3
55
install:
66
# This script is used by the Travis build to install a cookie for
77
# go.googlesource.com so rate limits are higher when using `go get` to fetch

CHANGELOG.md

Lines changed: 1118 additions & 123 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TEST?=$$(go list ./... | grep -v /vendor/)
1+
TEST?=$$(go list ./... | grep -v '/terraform/vendor/' | grep -v '/builtin/bins/')
22
VETARGS?=-all
33
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
44

@@ -29,16 +29,17 @@ core-dev: generate
2929

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

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

4041
# test runs the unit tests
41-
test: fmtcheck generate
42+
test: fmtcheck errcheck generate
4243
TF_ACC= go test $(TEST) $(TESTARGS) -timeout=30s -parallel=4
4344

4445
# testacc runs acceptance tests
@@ -50,6 +51,14 @@ testacc: fmtcheck generate
5051
fi
5152
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
5253

54+
test-compile: fmtcheck generate
55+
@if [ "$(TEST)" = "./..." ]; then \
56+
echo "ERROR: Set TEST to a specific package. For example,"; \
57+
echo " make test-compile TEST=./builtin/providers/aws"; \
58+
exit 1; \
59+
fi
60+
go test -c $(TEST) $(TESTARGS)
61+
5362
# testrace runs the race checker
5463
testrace: fmtcheck generate
5564
TF_ACC= go test -race $(TEST) $(TESTARGS)
@@ -76,10 +85,10 @@ vet:
7685
# generate runs `go generate` to build the dynamically generated
7786
# source files.
7887
generate:
79-
@which stringer ; if [ $$? -ne 0 ]; then \
88+
@which stringer > /dev/null; if [ $$? -ne 0 ]; then \
8089
go get -u golang.org/x/tools/cmd/stringer; \
8190
fi
82-
go generate $$(go list ./... | grep -v /vendor/)
91+
go generate $$(go list ./... | grep -v /terraform/vendor/)
8392
@go fmt command/internal_plugin_list.go > /dev/null
8493

8594
fmt:
@@ -88,4 +97,7 @@ fmt:
8897
fmtcheck:
8998
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
9099

100+
errcheck:
101+
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"
102+
91103
.PHONY: bin default generate test vet fmt fmtcheck tools

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Terraform
22
=========
33

44
- Website: http://www.terraform.io
5-
- IRC: `#terraform-tool` on Freenode
5+
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
66
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)
77

88
![Terraform](https://raw.githubusercontent.com/hashicorp/terraform/master/website/source/assets/images/readme.png)
@@ -29,13 +29,14 @@ All documentation is available on the [Terraform website](http://www.terraform.i
2929
Developing Terraform
3030
--------------------
3131

32-
If you wish to work on Terraform itself or any of its built-in providers, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.6+ is *required*). Alternatively, you can use the Vagrantfile in the root of this repo to stand up a virtual machine with the appropriate dev tooling already set up for you.
32+
If you wish to work on Terraform itself or any of its built-in providers, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.7+ is *required*). Alternatively, you can use the Vagrantfile in the root of this repo to stand up a virtual machine with the appropriate dev tooling already set up for you.
3333

3434
For local dev first make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH). You will also need to add `$GOPATH/bin` to your `$PATH`.
3535

3636
Next, using [Git](https://git-scm.com/), clone this repository into `$GOPATH/src/github.com/hashicorp/terraform`. All the necessary dependencies are either vendored or automatically installed, so you just need to type `make`. This will compile the code and then run the tests. If this exits with exit status 0, then everything is working!
3737

3838
```sh
39+
$ cd $GOPATH/src/github.com/hashicorp/terraform
3940
$ make
4041
```
4142

@@ -83,15 +84,15 @@ Assuming your work is on a branch called `my-feature-branch`, the steps look lik
8384

8485
1. Add the new package to your GOPATH:
8586

86-
```bash
87-
go get github.com/hashicorp/my-project
88-
```
87+
```bash
88+
go get github.com/hashicorp/my-project
89+
```
8990

9091
2. Add the new package to your vendor/ directory:
9192

92-
```bash
93-
govendor add github.com/hashicorp/my-project/package
94-
```
93+
```bash
94+
govendor add github.com/hashicorp/my-project/package
95+
```
9596

9697
3. Review the changes in git and commit them.
9798

@@ -101,9 +102,9 @@ To update a dependency:
101102

102103
1. Fetch the dependency:
103104

104-
```bash
105-
govendor fetch github.com/hashicorp/my-project
106-
```
105+
```bash
106+
govendor fetch github.com/hashicorp/my-project
107+
```
107108

108109
2. Review the changes in git and commit them.
109110

@@ -118,10 +119,10 @@ built-in providers. Our [Contributing Guide](https://github.com/hashicorp/terraf
118119

119120
If you wish to cross-compile Terraform for another architecture, you can set the `XC_OS` and `XC_ARCH` environment variables to values representing the target operating system and architecture before calling `make`. The output is placed in the `pkg` subdirectory tree both expanded in a directory representing the OS/architecture combination and as a ZIP archive.
120121

121-
For example, to compile 64-bit Linux binaries on Mac OS X Linux, you can run:
122+
For example, to compile 64-bit Linux binaries on Mac OS X, you can run:
122123

123124
```sh
124-
$ XC_OS=linux XC_ARCH=amd64 make bin
125+
$ XC_OS=linux XC_ARCH=amd64 make bin
125126
...
126127
$ file pkg/linux_amd64/terraform
127128
terraform: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

Vagrantfile

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,65 @@
55
VAGRANTFILE_API_VERSION = "2"
66

77
$script = <<SCRIPT
8-
GOVERSION="1.6"
8+
GOVERSION="1.7.3"
99
SRCROOT="/opt/go"
1010
SRCPATH="/opt/gopath"
1111
1212
# Get the ARCH
13-
ARCH=`uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|'`
13+
ARCH="$(uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|')"
1414
1515
# Install Prereq Packages
16-
sudo apt-get update
17-
sudo apt-get upgrade -y
18-
sudo apt-get install -y build-essential curl git-core libpcre3-dev mercurial pkg-config zip
16+
export DEBIAN_PRIORITY=critical
17+
export DEBIAN_FRONTEND=noninteractive
18+
export DEBCONF_NONINTERACTIVE_SEEN=true
19+
APT_OPTS="--yes --force-yes --no-install-suggests --no-install-recommends"
20+
echo "Upgrading packages ..."
21+
apt-get update ${APT_OPTS} >/dev/null
22+
apt-get upgrade ${APT_OPTS} >/dev/null
23+
echo "Installing prerequisites ..."
24+
apt-get install ${APT_OPTS} build-essential curl git-core libpcre3-dev mercurial pkg-config zip >/dev/null
1925
2026
# Install Go
21-
cd /tmp
22-
wget --quiet https://storage.googleapis.com/golang/go${GOVERSION}.linux-${ARCH}.tar.gz
23-
tar -xvf go${GOVERSION}.linux-${ARCH}.tar.gz
24-
sudo mv go $SRCROOT
25-
sudo chmod 775 $SRCROOT
26-
sudo chown vagrant:vagrant $SRCROOT
27+
echo "Downloading go (${GOVERSION}) ..."
28+
wget -P /tmp --quiet "https://storage.googleapis.com/golang/go${GOVERSION}.linux-${ARCH}.tar.gz"
29+
echo "Setting up go (${GOVERSION}) ..."
30+
tar -C /opt -xf "/tmp/go${GOVERSION}.linux-${ARCH}.tar.gz"
31+
chmod 775 "$SRCROOT"
32+
chown vagrant:vagrant "$SRCROOT"
2733
2834
# Setup the GOPATH; even though the shared folder spec gives the working
2935
# directory the right user/group, we need to set it properly on the
3036
# parent path to allow subsequent "go get" commands to work.
31-
sudo mkdir -p $SRCPATH
32-
sudo chown -R vagrant:vagrant $SRCPATH 2>/dev/null || true
37+
mkdir -p "$SRCPATH"
38+
chown -R vagrant:vagrant "$SRCPATH" 2>/dev/null || true
3339
# ^^ silencing errors here because we expect this to fail for the shared folder
3440
35-
cat <<EOF >/tmp/gopath.sh
41+
install -m0755 /dev/stdin /etc/profile.d/gopath.sh <<EOF
3642
export GOPATH="$SRCPATH"
3743
export GOROOT="$SRCROOT"
3844
export PATH="$SRCROOT/bin:$SRCPATH/bin:\$PATH"
3945
EOF
40-
sudo mv /tmp/gopath.sh /etc/profile.d/gopath.sh
41-
sudo chmod 0755 /etc/profile.d/gopath.sh
42-
source /etc/profile.d/gopath.sh
46+
47+
cat >>/home/vagrant/.bashrc <<EOF
48+
49+
## After login, change to terraform directory
50+
cd /opt/gopath/src/github.com/hashicorp/terraform
51+
EOF
52+
4353
SCRIPT
4454

4555
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
46-
config.vm.box = "bento/ubuntu-12.04"
56+
config.vm.box = "bento/ubuntu-14.04"
4757
config.vm.hostname = "terraform"
4858

49-
config.vm.provision "shell", inline: $script, privileged: false
59+
config.vm.provision "prepare-shell", type: "shell", inline: "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile", privileged: false
60+
config.vm.provision "initial-setup", type: "shell", inline: $script
5061
config.vm.synced_folder '.', '/opt/gopath/src/github.com/hashicorp/terraform'
5162

63+
config.vm.provider "docker" do |v, override|
64+
override.vm.box = "tknerr/baseimage-ubuntu-14.04"
65+
end
66+
5267
["vmware_fusion", "vmware_workstation"].each do |p|
5368
config.vm.provider p do |v|
5469
v.vmx["memsize"] = "4096"
@@ -60,4 +75,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
6075
v.memory = 4096
6176
v.cpus = 2
6277
end
78+
79+
config.vm.provider "parallels" do |prl|
80+
prl.memory = 4096
81+
prl.cpus = 2
82+
end
6383
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"github.com/hashicorp/terraform/builtin/providers/archive"
5+
"github.com/hashicorp/terraform/plugin"
6+
)
7+
8+
func main() {
9+
plugin.Serve(&plugin.ServeOpts{
10+
ProviderFunc: archive.Provider,
11+
})
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"github.com/hashicorp/terraform/builtin/providers/bitbucket"
5+
"github.com/hashicorp/terraform/plugin"
6+
)
7+
8+
func main() {
9+
plugin.Serve(&plugin.ServeOpts{
10+
ProviderFunc: bitbucket.Provider,
11+
})
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"github.com/hashicorp/terraform/builtin/providers/logentries"
5+
"github.com/hashicorp/terraform/plugin"
6+
)
7+
8+
func main() {
9+
plugin.Serve(&plugin.ServeOpts{
10+
ProviderFunc: logentries.Provider,
11+
})
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package main

0 commit comments

Comments
 (0)