Commit Graph

83 Commits

Author SHA1 Message Date
Radek Simko 5b9f2fafc8 Standardise directory name for test data 2019-06-30 10:16:15 +02:00
Robert J b4e8e63618 Create smaller docker images for releases
Now we'll use build containers to perform preparation steps, causing the release
images to contain only Terraform itself and git/openssh.
2019-04-10 10:06:04 -07:00
Kristin Laemmert 6c896bc456
build: refresh go.googlesource.com cookie (#20558) 2019-03-05 08:31:36 -08:00
Sander van Harmelen 03e82687d6 build.sh: only set git commit info for dev builds
This commit fixes a problem where `make bin` would strip of any prerelease info.
2019-02-06 20:32:54 +01:00
Martin Atkins 6330abae33 build: Periodic refresh of our go.googlesource.com cookie
Just as with 336b352d6f, this refreshes our rate limit bypass cookie for
go.googlesource.com since the old one has apparently expired.

I did this by visiting https://go.googlesource.com/ and selecting
"Generate Password" from the top navigation. This cookie belongs to a
test account used by the Terraform team and should not be used by
non-Terraform codebases; please generate your own!
2019-02-01 16:01:59 -08:00
Martin Atkins c133de863b build: Update most things for Go 1.11 modules
We're still using vendoring for now until we get _all_ of our tooling
updated, so the main idea here is to force use of the vendor directory
when running tests and building for development so we can quickly find
situations where we forget to run "go mod vendor".

We also setting GO111MODULE=off for installation of tools. Right now this
is the best way to install a tool in GOBIN without also interfering with
go.mod and go.sum, until a better pattern for managing tool dependencies
is devised by the Go team.

Finally, we run "go mod download" before launching "gox" in the main
build process, to prime the local module cache once so that the concurrent
"go build" processes won't race to populate it redundantly. This means
that we'll be producing final builds from the module cache rather than
from vendor as with everything else -- there's currently no way to tell
gox to use -mod=vendor -- but that should be fine in practice since
our go.sum file will ensure that we get the exact sources we expect in
the module cache before building.
2018-11-19 09:02:35 -08:00
Loren Gordon 55d4e460de Uses the current working directory to name the built binary
This patch allows `build.sh` to be used with terraform plugins to
easily create cross-platform packages, using the same method as the
terraform Makefile:

```
mkdir scripts
curl https://raw.githubusercontent.com/hashicorp/terraform/master/scripts/build.sh -o scripts/build.sh
TF_RELEASE=1 sh -c "scripts/build.sh"  # make bin
```
2017-10-30 10:49:47 -07:00
Clint 385e564250 fix build ld_flag (#16430) 2017-10-24 14:10:15 -05:00
Martin Atkins b5403059e6 scripts: helper for launching Terraform in the dlv debugger
This launches Terraform inside a headless dlv configured to accept a
remote debugging process. It's configured this way so it can be easily
used from a debugger GUI integrated into an IDE/editor, but it can also
be used from the CLI by running the command it prints.

Using a remote debugger here is useful even when debugging with the CLI,
since it keeps Terraform's verbose and colorful output from interfering
with the debugger UI.
2017-10-16 17:51:54 -07:00
Martin Atkins 336b352d6f Update our go.googlesource.com rate-limit cookie
We have a generated cookie for googlesource.com so that we don't get so rate-limited when cloning Google-hosted Go libraries.

The previous credential was invalidated, so this is a newly-generated one. This credential does nothing except allow us to fetch git repositories from go.googlesource.com with a slightly-higher rate limit.
2017-10-06 11:43:28 -07:00
James Bardin 18af7750d4 Merge pull request #14720 from sevagh/master
Add salt-masterless provisioner
2017-08-16 16:47:46 -04:00
Martin Atkins 5c8ff928ba build: scripted local build process for docker images
#15596 set things up with the intent that the docker image build process
would be handled by the automated build system on dockerhub, but after
merging we found that it's impossible to change the source git repository
for an existing dockerhub repository.

To get away from the limitations of dockerhub, we intend to eventually
automate these builds in a separate CI system. Here we add some scripts
that would drive such an automated process. It's split into multiple steps
to allow for situations where the new version should not be tagged as
the latest, and to make it easier and safer to test the build script
while doing development on it.

Since this automated process doesn't yet exist, a wrapper script
release.sh is included to help run a local, manual build and deploy
process in the mean time. The README.md in the docker-release dir here
contains details on the intended usage.
2017-08-14 12:16:21 -07:00
Sevag Hanssian 867760ed56 Add salt-masterless provisioner 2017-08-07 10:00:29 -04:00
Martin Atkins 2b3b62dab5 build: documentation for the new docker image release process
At the time of commit this file contains some things that are not yet true
due to the dockerhub configuration not having been updated. This therefore
remains aspirational until merged, after which the docherhub configuration
will be updated.
2017-07-19 13:02:39 -07:00
Martin Atkins 0f9af4dfa9 build: configuration for building "release" docker images
These are different than our "full" images because they include a binary
already released to releases.hashicorp.com, whereas the root Dockerfile
directly builds from the current work tree.

This particular Dockerfile is not intended to be run manually, but rather
exists only to drive the dockerhub automated build.
2017-07-19 12:59:13 -07:00
James Bardin 77a32f3df0 remove "core" distinction
Since there is little left that isn't core, remove the distinction for
now to reduce confusion, since a "core" binary will mostly work except
for provisioners.
2017-06-12 13:43:54 -04:00
James Bardin 1bd0205e49 remove errcheck
The existing harness was only for aws, which fails now that aws is gone.
2017-06-12 13:43:52 -04:00
James Bardin 6fcc3e0104 remove hard-coded opc provider and providers tests 2017-06-12 13:42:07 -04:00
Jake Champlin 7894478c8c Merge pull request #14681 from svanharmelen/f-review
Use `helpers.shema.Provisoner` in Chef provisioner V2
2017-05-30 14:26:51 -04:00
Jake Champlin 91ab75991d
core: use codified default for prerelease string 2017-05-22 11:28:15 -04:00
Jake Champlin bd68789006
core: Use environment variables to set VersionPrerelease at compile time
Instead of using a hardcoded version prerelease string, which makes release automation difficult, set the version prerelease string from an environment variable via the go linker tool during compile time.

The environment variable `TF_RELEASE` should only be set via the `make bin` target, and thus leaves the version prerelease string unset. Otherwise, when running a local compile of terraform via the `make dev` makefile target, the version prerelease string is set to `"dev"`, as usual.

This also requires some changes to both the circonus and postgresql providers, as they directly used the `VersionPrerelease` constant. We now simply call the `VersionString()` function, which returns the proper interpolated version string with the prerelease string populated correctly.

`TF_RELEASE` is unset:

```sh
$ make dev
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/22 10:38:19 Generated command/internal_plugin_list.go
==> Removing old directory...
==> Building...
Number of parallel builds: 3

-->     linux/amd64: github.com/hashicorp/terraform

==> Results:
total 209M
-rwxr-xr-x 1 jake jake 209M May 22 10:39 terraform

$ terraform version
Terraform v0.9.6-dev (fd472e4a86500606b03c314f70d11f2bc4bc84e5+CHANGES)
```

`TF_RELEASE` is set (mimicking the `make bin` target):

```sh
$ TF_RELEASE=1 make dev
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/22 10:40:39 Generated command/internal_plugin_list.go
==> Removing old directory...
==> Building...
Number of parallel builds: 3

-->     linux/amd64: github.com/hashicorp/terraform

==> Results:
total 121M
-rwxr-xr-x 1 jake jake 121M May 22 10:42 terraform

$ terraform version
Terraform v0.9.6
```
2017-05-22 10:49:15 -04:00
Vladislav Rassokhin df4342bc3d Regenerate plugin list since provisioners were changed in previous commits 2017-05-19 20:54:08 +02:00
Paul Stack 055c18e302 core/provider-split: Split out the Oracle OPC provider to new structure (#14362)
* core/providersplit: Split OPC Provider to separate repo

As we march towards Terraform 0.10.0, we are going to start building the
terraform providers as separate binaries - this will allow us to
continually release them. Before we go to 0.10.0, we need to be able to
continue building providers in the same manner, therefore, we have
hardcoded the path of the provider in the generate-plugins.go file

The interim solution will require us to vendor the opc provider and any
child dependencies, but when we get to 0.10.0, we will no longer have to
do this - the core will auto download the plugin binary. The plugin
package will have it's own dependencies vendored as well.

* core/providersplit: Removing the builtin version of OPC provider

* core/providersplit: Vendoring the OPC plugin

* core/providersplit: update internal plugin list

* core/providersplit: remove unused govendor item
2017-05-16 19:53:25 +03:00
Mitchell Hashimoto cde458d74f
scripts: update tests for generate plugins to pass new style 2017-01-26 15:10:03 -08:00
Mitchell Hashimoto 447a5c8b9e
scripts: update internal plugin gen to support new provisioner 2017-01-26 15:09:52 -08:00
James Bardin f85232a239 Remove darwin/386 from the build
There isn't a supported configuration that runs darwin/386, so remove it
from the build.
2016-11-16 13:46:57 -05:00
Anton Babenko f13abccd30 Fixed regexp to process comma-separated links to github issues in CHANGELOG.md 2016-10-27 20:07:37 +02:00
Clint 740b8bb9cb provider/aws: Run errcheck in tests (#8579)
* provider/aws: Add errcheck to Makefile, error on unchecked errors

* more exceptions

* updates for errcheck to pass

* reformat and spilt out the ignore statements

* narrow down ignores

* fix typo, only ignore Close and Write, instead of close or write
2016-09-02 09:24:17 -05:00
Jake Champlin 8cbef79dbf Allow specifying ldflags via env vars
Allows specifying `LD_FLAGS` during development builds.

```
$ LD_FLAGS="-linkmode=external" make dev
```

Since the version of DTrace on macOS Sierra (On the public beta's at least) has been updated, this allows DTrace to run on Terraform during development/debugging.

```
$ sudo dtrace -n 'pid$target::main.main:entry' -c "terraform apply"
dtrace: description 'pid$target::main.main:entry' matched 1 probe

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

foo = bar
dtrace: pid 23096 has exited
CPU     ID                    FUNCTION:NAME
  2 265673                  main.main:entry
```

Also redirects the `@which stringer` command inside the `generate` Makefile target to `/dev/null` so we stop echoing the path to the `stringer` binary on every call to `generate`.
2016-08-24 10:56:23 -04:00
James Nugent 11259dee07 build: Exclude darwin/arm from OS/Arch targets
Fixes #8365
2016-08-22 14:34:53 +02:00
Paul Hinze bb51834a4d
scripts/dist.sh: tweaks for recent hc-releases 2016-07-15 18:38:47 -06:00
Gabi Davar 33b3206ead make linux amd64 binaries static again.
* regression caused by mitchellh/gox#49
* pass CGO_ENABLED=0
2016-06-10 16:23:11 +03:00
Adam Ward 4a29be7b50 Don't assume dev platform was built 2016-05-16 10:00:44 +10:00
Chris Bednarski 6360e6c8b6 Implemented internal plugin calls; which allows us to compile plugins into the main terraform binary 2016-05-10 14:40:11 -04:00
Soren Mathiasen f44706c661 Reduce the size of the binaries 2016-04-19 15:15:56 +02:00
Chris Bednarski 77f8432d2f Improve performance of fmtcheck
Previously gofmt would run even on files under vendor which we don't care about, and then discard the results. This approach instead selects only the files we want to pass into gofmt.

- Before takes around 6.5 seconds
- Now takes around 2 seconds
2016-03-31 13:57:09 -07:00
Paul Hinze d38ee00039 travis: switch to unencrypted cookie
Otherwise rate limiting fix does not work for PRs from forks
2016-03-21 13:35:53 -05:00
Paul Hinze 39b5bd0efb travis: add git cookie to get higher rate limits for `go get`
Should fix messages like this from the Travis builds:

```
Daily bandwidth rate limit exceeded for IP 52.0.240.122.
```

Refs https://github.com/golang/go/issues/12933
2016-03-21 08:36:18 -05:00
Paul Hinze f001ca6c83 CHANGELOG: generate links, tweak script
Changelog link generation script gets:

 * OS X compatibility
 * Support for multiple links on a line
2016-03-16 09:55:01 -05:00
Martin Atkins 4121f79d11 Merge pull request #5313 from hashicorp/f-changelog-links
Script to linkify github issue references in CHANGELOG.md
2016-02-25 10:41:09 -08:00
Paul Hinze 0cf6ba6f64 README/Makefile: Mention & auto-install gox 2016-02-25 06:48:43 -06:00
Martin Atkins 94ff15fe5b Script to linkify github issue references in CHANGELOG.md
This fixes #4439 by making a compromise: the issues under the "unreleased"
heading will still not be links, because it's inconvenient for the
committers team to write out those links manually for each merge. However,
we'll run this script on release so that all of the *released* changes
are presented as clickable links, so people can quickly read through the
set of changes in each new release.
2016-02-24 17:34:14 -08:00
Paul Hinze d21b0897a9 Makefile/docs: Lock in 1.6 req, doc vendored deps
* Drop Go 1.5 compatibility env vars
 * Drop `make updatedeps` from `Makefile` and docs
 * Update README w/ vendored dep instructions
2016-02-24 16:13:49 -06:00
Paul O'Connor e3c6c05395 Put the equals in the correct place 2016-02-17 17:44:38 +01:00
Paul O'Connor 21f15aea3f Use new link ldflags syntax 2016-02-17 17:35:04 +01:00
Paul Hinze 6791172e21 build.sh: don't dive into vendored deps when building
Doing a straight `./...`  build results in errors from unvendored
package references being picked up in some vendored libraries'
`examples/` subdirs.

So we'll switch to the recommended `go list | grep -v /vendor/` strategy
to determine what to build.
2016-02-01 11:28:41 -06:00
Paul Hinze 6fe2703665 Vendor all dependencies w/ Godep
* Remove `make updatedeps` from Travis build. We'll follow up with more
   specific plans around dependency updating in subsequent PRs.
 * Update all `make` targets to set `GO15VENDOREXPERIMENT=1` and to
   filter out `/vendor/` from `./...` where appropriate.
 * Temporarily remove `vet` from the `make test` target until we can
   figure out how to get it to not vet `vendor/`. (Initial
   experimentation failed to yield the proper incantation.)

Everything is pinned to current master, with the exception of:

 * Azure/azure-sdk-for-go which is pinned before the breaking change today
 * aws/aws-sdk-go which is pinned to the most recent tag

The documentation still needs to be updated, which we can do in a follow
up PR. The goal here is to unblock release.
2016-01-29 15:08:48 -06:00
Seth Vargo 6855c4c4e0 Remove old heroku stuffs 2016-01-14 16:00:35 -05:00
James Nugent 094e380bb1 Add Solaris builds of Terraform 2016-01-05 09:53:19 -05:00
James Nugent 45a3b5c542 Add script for running tests in Travis 2015-12-22 11:27:04 -05:00