-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmain.go
More file actions
22 lines (18 loc) · 715 Bytes
/
main.go
File metadata and controls
22 lines (18 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main
import (
"os"
"github.com/codefresh-io/terraform-provider-codefresh/codefresh"
"github.com/codefresh-io/terraform-provider-codefresh/codefresh/envutil"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
)
// Generate the Terraform provider documentation using `tfplugindocs`:
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
func main() {
debugMode := (os.Getenv(codefresh.ENV_CODEFRESH_PLUGIN_DEBUG) != "")
providerAddr := envutil.GetEnvAsString(codefresh.ENV_CODEFRESH_PLUGIN_ADDR, codefresh.DEFAULT_CODEFRESH_PLUGIN_ADDR)
plugin.Serve(&plugin.ServeOpts{
ProviderAddr: providerAddr,
ProviderFunc: codefresh.Provider,
Debug: debugMode,
})
}