Merge pull request #137 from ddelnano/ddelnano/ensure-version-is-set-via-linker-on-releases
Fix plugin installation on 1.11.0 and later by fixing release version detection
This commit is contained in:
commit
2a36fae810
18
main.go
18
main.go
@ -6,30 +6,16 @@ import (
|
||||
|
||||
"github.com/xenserver/packer-builder-xenserver/builder/xenserver/iso"
|
||||
"github.com/xenserver/packer-builder-xenserver/builder/xenserver/xva"
|
||||
"github.com/xenserver/packer-builder-xenserver/version"
|
||||
|
||||
"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 = "v0.6.0"
|
||||
|
||||
// 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.RegisterBuilder("iso", new(iso.Builder))
|
||||
pps.RegisterBuilder("xva", new(xva.Builder))
|
||||
pps.SetVersion(PluginVersion)
|
||||
pps.SetVersion(version.PluginVersion)
|
||||
err := pps.Run()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err.Error())
|
||||
|
19
version/version.go
Normal file
19
version/version.go
Normal file
@ -0,0 +1,19 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/packer-plugin-sdk/version"
|
||||
)
|
||||
|
||||
var (
|
||||
// Version is the main version number that is being run at the moment.
|
||||
Version = "v0.6.0"
|
||||
|
||||
// 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 = "dev"
|
||||
|
||||
// PluginVersion is used by the plugin set to allow Packer to recognize
|
||||
// what version this plugin is.
|
||||
PluginVersion = version.InitializePluginVersion(Version, VersionPrerelease)
|
||||
)
|
Loading…
Reference in New Issue
Block a user