packer-cn/builder/hyperone/step_chroot_provision.go

29 lines
814 B
Go
Raw Normal View History

2019-01-28 06:30:15 -05:00
package hyperone
import (
"context"
"github.com/hashicorp/packer/packer"
2020-11-17 19:31:03 -05:00
"github.com/hashicorp/packer/packer-plugin-sdk/multistep"
"github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps"
2019-01-28 06:30:15 -05:00
)
type stepChrootProvision struct{}
func (s *stepChrootProvision) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
config := state.Get("config").(*Config)
wrappedCommand := state.Get("wrappedCommand").(CommandWrapper)
sshCommunicator := state.Get("communicator").(packer.Communicator)
comm := &ChrootCommunicator{
Chroot: config.ChrootMountPath,
CmdWrapper: wrappedCommand,
Wrapped: sshCommunicator,
}
stepProvision := commonsteps.StepProvision{Comm: comm}
2019-01-28 06:30:15 -05:00
return stepProvision.Run(ctx, state)
}
func (s *stepChrootProvision) Cleanup(multistep.StateBag) {}