terraform/builtin/providers/circonus
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
..
GNUmakefile Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
check.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
consts.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
data_source_circonus_account.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
data_source_circonus_account_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
data_source_circonus_collector.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
data_source_circonus_collector_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
interface.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
metric.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
metric_cluster.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
metric_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
provider.go core: Use environment variables to set VersionPrerelease at compile time 2017-05-22 10:49:15 -04:00
provider_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
resource_circonus_check_caql.go Add statsd support to the `circonus_check` resource. (#12820) 2017-03-17 18:34:00 -04:00
resource_circonus_check_caql_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_cloudwatch.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_cloudwatch_test.go Consolidate all testing tags to `lifecycle:unittest`. (#12994) 2017-03-23 09:12:19 +00:00
resource_circonus_check_consul.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
resource_circonus_check_consul_test.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
resource_circonus_check_http.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
resource_circonus_check_http_test.go Consolidate all testing tags to `lifecycle:unittest`. (#12994) 2017-03-23 09:12:19 +00:00
resource_circonus_check_httptrap.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_httptrap_test.go Consolidate all testing tags to `lifecycle:unittest`. (#12994) 2017-03-23 09:12:19 +00:00
resource_circonus_check_icmp_ping.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_icmp_ping_test.go Add the `check_id` out parameter to `circonus_check`. (#12832) 2017-03-17 18:36:10 -04:00
resource_circonus_check_json.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00
resource_circonus_check_json_test.go Consolidate all testing tags to `lifecycle:unittest`. (#12994) 2017-03-23 09:12:19 +00:00
resource_circonus_check_mysql.go Add statsd support to the `circonus_check` resource. (#12820) 2017-03-17 18:34:00 -04:00
resource_circonus_check_mysql_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_postgresql.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_postgresql_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_statsd.go Add statsd support to the `circonus_check` resource. (#12820) 2017-03-17 18:34:00 -04:00
resource_circonus_check_statsd_test.go Add statsd support to the `circonus_check` resource. (#12820) 2017-03-17 18:34:00 -04:00
resource_circonus_check_tcp.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_check_tcp_test.go Consolidate all testing tags to `lifecycle:unittest`. (#12994) 2017-03-23 09:12:19 +00:00
resource_circonus_check_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_contact.go Fix PagerDuty support for `circonus_contact_group`. (#12714) 2017-03-15 02:28:15 -07:00
resource_circonus_contact_test.go Fix PagerDuty support for `circonus_contact_group`. (#12714) 2017-03-15 02:28:15 -07:00
resource_circonus_graph.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_graph_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_metric.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_metric_cluster.go provider/circonus: Remove ValidateFunc from Computed-only field 2017-04-23 12:40:17 +02:00
resource_circonus_metric_cluster_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_metric_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
resource_circonus_rule_set.go Fix circonus)_rule_sets for optional links. (#12614) 2017-03-11 18:59:18 -08:00
resource_circonus_rule_set_test.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
tags.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
types.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
utils.go Circonus Provider (#12338) 2017-03-10 14:19:17 -06:00
validators.go Add `consul` check type to `circonus_check` resource (#13030) 2017-03-24 15:05:19 -07:00