hashicorp / hashicorp/packer-plugin-sdk

Packer Plugin SDK for Subcommand

Open
#179 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
42
Forks
62
Avg merge
29m
Merged PRs (30d)
2

Description

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

#### Community Note

Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

#### Description

I am docker user. docker can manage image by tar file.
Docker can manage image by tar 'file' for local file operator
( Command-based centralized management of images related to operating systems )

```text
# Save Image to File
docker image save [disk_file.tar] [loaded_dockerimage]

# Load from File
docker image load [disk_file.tar]

# Upload to Official/Selfhost Registry
docker push [loaded_dockerimage]

# Download to Official/Selfhost Registry
docker pull [dockerimagename from dockerhub]
```

Packer can't manage ISOfile by command

```text
# Save Image to File : This is What I want to make
packer push packer.box

# Load from File : This is What I want to make
packer image load [disk_file.iso]

# Upload to Official/Selfhost Registry : Maybe HCL PackerHub
packer push [packer.box]

# Download to Official/Selfhost Registry : Maybe HCL PackerHub
packer pull [packer.box]
```

![image](https://user-images.githubusercontent.com/77244047/235058169-77cd2077-56b8-44b9-8d51-2dfe9770eb94.png)

this is difference between Docker and Packer
**So I'd like to make ISO manager by packer command**
Even I can use Other tool, but Packer is only provisioning tool for ISOFile
And I Hope packer be All-in-One Tool.

#### Use Case(s)
**subcommand Is main program feature**
so.. if you make some feature for plugin developer, they can control subsubcommand

your team can make new SDK for this.
( and packer command team also have to make new subcommand for this. for example : packer plugincli )

```text
# packer plugin [SubCLI] [Option]
packer plugincli isomanager -save Centos.iso
packer plugincli isomanager -load Centos.iso
packer plugincli isomanager -info Centos-Stream8
packer plugincli isomanager -list Windows
```
Any relevant use-cases that you see.

#### Potential configuration

```go
import (
"github.com/hashicorp/packer-plugin-sdk/plugin"
)

// this part
type ExampleCLI struct{}

type ExampleBuilder struct{}
type FooPostProcessor struct{}
type BarProvisioner struct{}

func main() {
pps := plugin.NewSet()

// this part
pps.RegisterCLI("isomanager", new(ExampleCLI))

pps.RegisterBuilder("example", new(ExampleBuilder))
pps.RegisterBuilder(plugin.DEFAULT_NAME, new(AnotherBuilder))
pps.RegisterPostProcessor("foo", new(FooPostProcessor))
pps.RegisterProvisioner("bar", new(BarProvisioner))
err := pps.Run()
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
}
```

#### Potential References

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.