-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
57 lines (44 loc) · 1.76 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// (C) Copyright 2013-2024 Dassault Systemes SE. All Rights Reserved.
//
// This software is licensed under a BSD 3-Clause License.
// See the LICENSE file provided with this software.
package main
import (
"context"
"flag"
"log"
"github.com/nuodb/terraform-provider-nuodbaas/internal/provider"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
)
// Generate model structs and client for REST API:
//go:generate bin/oapi-codegen -config oapi-codegen.yaml -generate types -o openapi/types.go openapi.yaml
//go:generate bin/oapi-codegen -config oapi-codegen.yaml -generate client -o openapi/client.go openapi.yaml
//go:generate bin/oapi-codegen -config oapi-codegen.yaml -generate spec -o openapi/spec.go openapi.yaml
// Inject current version into examples:
//go:generate ./inject-version.sh
// Format Terraform examples:
//go:generate bin/terraform fmt -recursive ./examples/
// Generate documentation:
//go:generate bin/tfplugindocs generate --provider-name nuodbaas
var (
// The version from the Git tag is used by GoReleaser when publishing a
// release, but the release job is conditionalized on the Git tag matching
// the version in the code. `{{version}}` in the comment is a marker to
// enable scraping of the version.
//
// For more information on GoReleaser, see https://goreleaser.com/cookbooks/using-main.version/
version string = "1.4.0" // {{version}}
)
func main() {
var debug bool
flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve")
flag.Parse()
opts := providerserver.ServeOpts{
Address: "registry.terraform.io/nuodb/nuodbaas",
Debug: debug,
}
err := providerserver.Serve(context.Background(), provider.New(version), opts)
if err != nil {
log.Fatal(err.Error())
}
}