generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
46 lines (39 loc) · 1.42 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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package main
import (
"fmt"
"os"
"packer-plugin-hashicups/builder/order"
"packer-plugin-hashicups/datasource/coffees"
"packer-plugin-hashicups/datasource/ingredients"
"packer-plugin-hashicups/post-processor/receipt"
"packer-plugin-hashicups/provisioner/toppings"
"github.com/hashicorp/packer-plugin-sdk/plugin"
"github.com/hashicorp/packer-plugin-sdk/version"
)
var (
// Version is the main version number that is being run at the moment.
Version = "1.0.2"
// VersionPrerelease is A pre-release marker for the Version. If this is ""
// (empty string) then it means that it is a final release. Otherwise, this
// is a pre-release such as "dev" (in development), "beta", "rc1", etc.
VersionPrerelease = ""
// PluginVersion is used by the plugin set to allow Packer to recognize
// what version this plugin is.
PluginVersion = version.InitializePluginVersion(Version, VersionPrerelease)
)
func main() {
pps := plugin.NewSet()
pps.RegisterDatasource("coffees", new(coffees.Datasource))
pps.RegisterDatasource("ingredients", new(ingredients.Datasource))
pps.RegisterBuilder("order", new(order.Builder))
pps.RegisterProvisioner("toppings", new(toppings.Provisioner))
pps.RegisterPostProcessor("receipt", new(receipt.PostProcessor))
pps.SetVersion(PluginVersion)
err := pps.Run()
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
}