Skip to content

Commit

Permalink
Output Terraform lib version in version string (#75)
Browse files Browse the repository at this point in the history
* Add compatibility matrix to README

* Output Terraform compatibility in logs and version string
  • Loading branch information
raphink authored Jan 24, 2020
1 parent 61d3469 commit 5680ad5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ sign out of the proxy.
$ go get github.com/camptocamp/terraboard
```

## Compatibility Matrix

|Terraboard|Max Terraform version|
|----------|---------------------|
| 0.15.0 | 0.12.7 |
| 0.16.0 | 0.12.7 |
| 0.17.0 | 0.12.18 |
| 0.18.0 | 0.12.18 |


## Development

### Architecture
Expand Down
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"

tfversion "github.com/hashicorp/terraform/version"
"github.com/jessevdk/go-flags"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -107,7 +108,7 @@ func LoadConfig(version string) *Config {
}

if c.Version {
fmt.Printf("Terraboard v%v\n", version)
fmt.Printf("Terraboard v%v (built for Terraform v%v)\n", version, tfversion.Version)
os.Exit(0)
}

Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/camptocamp/terraboard/db"
"github.com/camptocamp/terraboard/state"
"github.com/camptocamp/terraboard/util"
tfversion "github.com/hashicorp/terraform/version"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -139,7 +140,7 @@ func main() {

util.SetBasePath(c.Web.BaseURL)

log.Infof("Terraboard v%s is starting...", version)
log.Infof("Terraboard v%s (built for Terraform v%s) is starting...", version, tfversion.Version)

err := c.SetupLogging()
if err != nil {
Expand Down

0 comments on commit 5680ad5

Please sign in to comment.