Skip to content

Commit

Permalink
Add make install
Browse files Browse the repository at this point in the history
As part of this change rename main.go so that "go install" produces
a file called "terraform-provider-hpegl-pcbe-terraform-resources".

The prefix "terraform-provider-" is required for terraform apply to
work.
  • Loading branch information
stuart-mclaren-hpe committed Aug 22, 2024
1 parent 2db4570 commit 1a70228
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
build:
go build ./...

build-experimental:
go build -tags experimental ./...
install:
go install ./...

test:
go test ./...
Expand All @@ -15,3 +15,9 @@ lint:
@golangci-lint --version
# Will use .golangci.yml
golangci-lint run

build-experimental:
go build -tags experimental ./...

install-experimental:
go install -tags experimental ./...
15 changes: 14 additions & 1 deletion main.go → ...er-hpegl-pcbe-terraform-resources/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
package main

import (
"context"
"flag"
"log"

"github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/provider"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
)

var (
version = "dev"
)

func main() {
var debug bool

Expand All @@ -16,8 +23,14 @@ func main() {
)
flag.Parse()

_ = providerserver.ServeOpts{
opts := providerserver.ServeOpts{
Address: "github.com/HewlettPackard/hpegl-pcbe-terraform-resources",
Debug: debug,
}

err := providerserver.Serve(context.Background(), provider.New(version), opts)

if err != nil {
log.Fatal(err.Error())
}
}

0 comments on commit 1a70228

Please sign in to comment.