Commit Graph

36 Commits

Author SHA1 Message Date
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
Radek Simko 0fc8882e29 Expose Terraform version internally & externally 2015-06-21 12:24:42 +01:00
Paul Hinze 943f7d0eaa setup next version for dev 2015-06-01 14:20:15 -05:00
Paul Hinze d829222796 v0.5.3 2015-06-01 14:02:38 -05:00
Mitchell Hashimoto ce9382eebc up version for dev 2015-05-15 20:37:07 -07:00
Mitchell Hashimoto 4ed2c8d956 v0.5.2 2015-05-15 11:14:44 -07:00
Mitchell Hashimoto 0c48db6c45 up version for dev 2015-05-07 15:56:16 -07:00
Mitchell Hashimoto 33e11f0eba v0.5.0 2015-05-07 15:26:49 -07:00
Mitchell Hashimoto 173d8df0ed up version for dev 2015-04-14 12:54:45 -07:00
Mitchell Hashimoto 8175d7f821 v0.4.2 2015-04-10 16:46:43 -07:00
Mitchell Hashimoto ed2e3636e5 update CHANGELOG 2015-04-09 11:20:14 -07:00
Mitchell Hashimoto 166efa1ba0 v0.4.1 2015-04-09 09:55:56 -07:00
Mitchell Hashimoto 2f37b80fb7 up version for dev 2015-04-02 11:38:10 -07:00
Mitchell Hashimoto 9fd14f1638 v0.4.0 2015-04-02 10:42:10 -07:00
Mitchell Hashimoto 8463c92102 up version for dev 2015-02-19 11:56:34 -08:00
Mitchell Hashimoto f4408f2e63 v0.3.7 2015-02-19 10:57:03 -08:00
Mitchell Hashimoto 2203ef82a4 up version for development 2015-01-06 16:32:47 -08:00
Mitchell Hashimoto 4e11ed4327 v0.3.6 2015-01-06 15:56:14 -08:00
Mitchell Hashimoto 5987ce30f9 up version for dev 2014-12-15 15:36:19 -08:00
Mitchell Hashimoto aeecabbb33 v0.3.5 2014-12-10 13:27:12 -08:00
Mitchell Hashimoto e30ee60c58 up version for dev 2014-10-21 11:23:58 -07:00
Mitchell Hashimoto 146d081b65 v0.3.1 2014-10-21 11:01:04 -07:00
Mitchell Hashimoto 2a388fd5d1 up version for dev 2014-10-15 20:28:37 -07:00
Mitchell Hashimoto 55e6987796 v0.3.0 2014-10-14 12:24:05 -07:00
Mitchell Hashimoto 61660b464b update dev version 2014-10-12 21:20:25 -07:00
Mitchell Hashimoto 267a125a07 Up version for dev 2014-09-09 15:29:54 -07:00
Mitchell Hashimoto c812ed41fd v0.2.2 2014-09-09 14:43:36 -07:00
Mitchell Hashimoto bea8ea9b25 up version for dev 2014-08-31 09:48:22 -07:00
Mitchell Hashimoto a32e1be8ce v0.2.1 2014-08-31 09:13:05 -07:00
Mitchell Hashimoto 0da47bab44 up version for dev 2014-08-28 16:47:35 -07:00
Mitchell Hashimoto 4c8c06ae2e v0.2.0 2014-08-28 09:54:43 -07:00
Mitchell Hashimoto 265f8895ce Up version for dev 2014-08-05 14:44:36 -07:00
Mitchell Hashimoto 0092f5a2cb v0.1.1 2014-08-05 14:19:20 -07:00
Mitchell Hashimoto 44489d2dfe Update version for dev 2014-07-28 22:57:00 -07:00
Armon Dadgar fd889083c2 Set version 0.1 2014-07-28 13:43:32 -04:00
Mitchell Hashimoto a4a4e3784d Implement CLI, version command 2014-05-24 12:04:43 -07:00