-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
54 lines (42 loc) · 1.81 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
// (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 -generate types -include-tags backups,backuppolicies,databases,projects -package openapi -o openapi/types.go openapi.yaml
//go:generate bin/oapi-codegen -generate client -include-tags backups,backuppolicies,databases,projects -package openapi -o openapi/client.go openapi.yaml
//go:generate bin/oapi-codegen -generate spec -include-tags backups,backuppolicies,databases,projects -package openapi -o openapi/spec.go openapi.yaml
//go:generate ./fix-generated.sh
// Format Terraform examples:
//go:generate bin/terraform fmt -recursive ./examples/
// Generate documentation:
//go:generate bin/tfplugindocs generate --provider-name nuodbaas
var (
// This will be overridden by the version from the Git tag when GoReleaser
// creates an actual release. `{{version}}` in the comment is a marker to
// enable scraping of the version when running `make package`.
//
// For more information on GoReleaser, see https://goreleaser.com/cookbooks/using-main.version/
version string = "1.1.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())
}
}