commit
bf7daa1d93
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -164,8 +165,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
b.config.SSHPrivateIp),
|
b.config.SSHPrivateIp),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&stepStopAlicloudInstance{
|
&stepStopAlicloudInstance{
|
||||||
@ -206,7 +207,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -17,6 +17,7 @@ import (
|
|||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/chroot"
|
"github.com/hashicorp/packer/common/chroot"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -478,7 +479,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
@ -298,8 +299,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&awscommon.StepSetGeneratedData{
|
&awscommon.StepSetGeneratedData{
|
||||||
GeneratedData: generatedData,
|
GeneratedData: generatedData,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&awscommon.StepStopEBSBackedInstance{
|
&awscommon.StepStopEBSBackedInstance{
|
||||||
@ -350,7 +351,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
@ -322,8 +323,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&awscommon.StepSetGeneratedData{
|
&awscommon.StepSetGeneratedData{
|
||||||
GeneratedData: generatedData,
|
GeneratedData: generatedData,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&awscommon.StepStopEBSBackedInstance{
|
&awscommon.StepStopEBSBackedInstance{
|
||||||
@ -389,7 +390,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
@ -299,8 +300,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&awscommon.StepSetGeneratedData{
|
&awscommon.StepSetGeneratedData{
|
||||||
GeneratedData: generatedData,
|
GeneratedData: generatedData,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&awscommon.StepStopEBSBackedInstance{
|
&awscommon.StepStopEBSBackedInstance{
|
||||||
@ -315,7 +316,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -369,8 +370,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&awscommon.StepSetGeneratedData{
|
&awscommon.StepSetGeneratedData{
|
||||||
GeneratedData: generatedData,
|
GeneratedData: generatedData,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&StepUploadX509Cert{},
|
&StepUploadX509Cert{},
|
||||||
@ -420,7 +421,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
packerAzureCommon "github.com/hashicorp/packer/builder/azure/common"
|
packerAzureCommon "github.com/hashicorp/packer/builder/azure/common"
|
||||||
"github.com/hashicorp/packer/builder/azure/common/constants"
|
"github.com/hashicorp/packer/builder/azure/common/constants"
|
||||||
"github.com/hashicorp/packer/builder/azure/common/lin"
|
"github.com/hashicorp/packer/builder/azure/common/lin"
|
||||||
packerCommon "github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -211,8 +211,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: lin.SSHHost,
|
Host: lin.SSHHost,
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&packerCommon.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&packerCommon.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
NewStepGetOSDisk(azureClient, ui),
|
NewStepGetOSDisk(azureClient, ui),
|
||||||
@ -254,7 +254,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&packerCommon.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
NewStepGetOSDisk(azureClient, ui),
|
NewStepGetOSDisk(azureClient, ui),
|
||||||
NewStepGetAdditionalDisks(azureClient, ui),
|
NewStepGetAdditionalDisks(azureClient, ui),
|
||||||
NewStepPowerOffCompute(azureClient, ui),
|
NewStepPowerOffCompute(azureClient, ui),
|
||||||
@ -279,7 +279,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = packerCommon.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, b.stateBag)
|
b.runner.Run(ctx, b.stateBag)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"github.com/hashicorp/packer/builder/azure/common/client"
|
"github.com/hashicorp/packer/builder/azure/common/client"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/chroot"
|
"github.com/hashicorp/packer/common/chroot"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -439,7 +440,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
steps := buildsteps(b.config, info)
|
steps := buildsteps(b.config, info)
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
packerAzureCommon "github.com/hashicorp/packer/builder/azure/common"
|
packerAzureCommon "github.com/hashicorp/packer/builder/azure/common"
|
||||||
"github.com/hashicorp/packer/builder/azure/common/constants"
|
"github.com/hashicorp/packer/builder/azure/common/constants"
|
||||||
"github.com/hashicorp/packer/builder/azure/common/lin"
|
"github.com/hashicorp/packer/builder/azure/common/lin"
|
||||||
packerCommon "github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -187,8 +187,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: lin.SSHHost,
|
Host: lin.SSHHost,
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&packerCommon.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&packerCommon.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
NewStepPowerOffCompute(azureClient, ui, b.config),
|
NewStepPowerOffCompute(azureClient, ui, b.config),
|
||||||
@ -215,7 +215,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&packerCommon.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
NewStepPowerOffCompute(azureClient, ui, b.config),
|
NewStepPowerOffCompute(azureClient, ui, b.config),
|
||||||
NewStepCaptureImage(azureClient, ui, b.config),
|
NewStepCaptureImage(azureClient, ui, b.config),
|
||||||
NewStepPublishToSharedImageGallery(azureClient, ui, b.config),
|
NewStepPublishToSharedImageGallery(azureClient, ui, b.config),
|
||||||
@ -237,7 +237,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = packerCommon.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, b.stateBag)
|
b.runner.Run(ctx, b.stateBag)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -60,7 +60,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
// Build the steps.
|
// Build the steps.
|
||||||
steps := []multistep.Step{
|
steps := []multistep.Step{
|
||||||
&stepPrepareConfig{},
|
&stepPrepareConfig{},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -85,8 +85,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
SSHPort: commPort,
|
SSHPort: commPort,
|
||||||
WinRMPort: commPort,
|
WinRMPort: commPort,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
&stepShutdownInstance{},
|
&stepShutdownInstance{},
|
||||||
@ -94,7 +94,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Configure the runner and run the steps.
|
// Configure the runner and run the steps.
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
"github.com/hashicorp/packer/common/uuid"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -20,7 +21,7 @@ import (
|
|||||||
// Config holds all the details needed to configure the builder.
|
// Config holds all the details needed to configure the builder.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
Comm communicator.Config `mapstructure:",squash"`
|
Comm communicator.Config `mapstructure:",squash"`
|
||||||
|
|
||||||
// The CloudStack API endpoint we will connect to. It can
|
// The CloudStack API endpoint we will connect to. It can
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/digitalocean/godo"
|
"github.com/digitalocean/godo"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -91,8 +91,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "droplet_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "droplet_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
new(stepShutdown),
|
new(stepShutdown),
|
||||||
@ -103,7 +103,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps
|
// Run the steps
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -70,8 +70,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
"dockerWindowsContainer": &StepConnectDocker{},
|
"dockerWindowsContainer": &StepConnectDocker{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -95,8 +95,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
WinRMConfig: winrmConfig,
|
WinRMConfig: winrmConfig,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
steps = append(steps, new(StepTeardownInstance), new(StepCreateImage))
|
steps = append(steps, new(StepTeardownInstance), new(StepCreateImage))
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -61,15 +61,15 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: getServerIP,
|
Host: getServerIP,
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
&stepShutdownServer{},
|
&stepShutdownServer{},
|
||||||
&stepCreateSnapshot{},
|
&stepCreateSnapshot{},
|
||||||
}
|
}
|
||||||
// Run the steps
|
// Run the steps
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -91,13 +91,13 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
steps = append(steps,
|
steps = append(steps,
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&stepStopVM{},
|
&stepStopVM{},
|
||||||
&stepCreateImage{},
|
&stepCreateImage{},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -3,7 +3,7 @@ package hyperone
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -21,7 +21,7 @@ func (s *stepChrootProvision) Run(ctx context.Context, state multistep.StateBag)
|
|||||||
Wrapped: sshCommunicator,
|
Wrapped: sshCommunicator,
|
||||||
}
|
}
|
||||||
|
|
||||||
stepProvision := common.StepProvision{Comm: comm}
|
stepProvision := commonsteps.StepProvision{Comm: comm}
|
||||||
return stepProvision.Run(ctx, state)
|
return stepProvision.Run(ctx, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
powershell "github.com/hashicorp/packer/builder/hyperv/common/powershell"
|
powershell "github.com/hashicorp/packer/builder/hyperv/common/powershell"
|
||||||
"github.com/hashicorp/packer/builder/hyperv/common/powershell/hyperv"
|
"github.com/hashicorp/packer/builder/hyperv/common/powershell/hyperv"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -36,8 +37,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CommonConfig struct {
|
type CommonConfig struct {
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
// The block size of the VHD to be created.
|
// The block size of the VHD to be created.
|
||||||
// Recommended disk block size for Linux hyper-v guests is 1 MiB. This
|
// Recommended disk block size for Linux hyper-v guests is 1 MiB. This
|
||||||
// defaults to "32" MiB.
|
// defaults to "32" MiB.
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
hypervcommon "github.com/hashicorp/packer/builder/hyperv/common"
|
hypervcommon "github.com/hashicorp/packer/builder/hyperv/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -53,8 +54,8 @@ type Builder struct {
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
hypervcommon.OutputConfig `mapstructure:",squash"`
|
hypervcommon.OutputConfig `mapstructure:",squash"`
|
||||||
hypervcommon.SSHConfig `mapstructure:",squash"`
|
hypervcommon.SSHConfig `mapstructure:",squash"`
|
||||||
@ -193,11 +194,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&hypervcommon.StepCreateBuildDir{
|
&hypervcommon.StepCreateBuildDir{
|
||||||
TempPath: b.config.TempPath,
|
TempPath: b.config.TempPath,
|
||||||
},
|
},
|
||||||
&common.StepOutputDir{
|
&commonsteps.StepOutputDir{
|
||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
ResultKey: "iso_path",
|
ResultKey: "iso_path",
|
||||||
@ -205,12 +206,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
TargetPath: b.config.TargetPath,
|
TargetPath: b.config.TargetPath,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -255,7 +256,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
||||||
Generation: b.config.Generation,
|
Generation: b.config.Generation,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -298,10 +299,10 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
|
|
||||||
// provision requires communicator to be setup
|
// provision requires communicator to be setup
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
|
|
||||||
// Remove ephemeral key from authorized_hosts if using SSH communicator
|
// Remove ephemeral key from authorized_hosts if using SSH communicator
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.SSHConfig.Comm,
|
Comm: &b.config.SSHConfig.Comm,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -337,7 +338,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
powershell "github.com/hashicorp/packer/builder/hyperv/common/powershell"
|
powershell "github.com/hashicorp/packer/builder/hyperv/common/powershell"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -44,8 +45,8 @@ type Builder struct {
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
hypervcommon.OutputConfig `mapstructure:",squash"`
|
hypervcommon.OutputConfig `mapstructure:",squash"`
|
||||||
hypervcommon.SSHConfig `mapstructure:",squash"`
|
hypervcommon.SSHConfig `mapstructure:",squash"`
|
||||||
@ -233,11 +234,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&hypervcommon.StepCreateBuildDir{
|
&hypervcommon.StepCreateBuildDir{
|
||||||
TempPath: b.config.TempPath,
|
TempPath: b.config.TempPath,
|
||||||
},
|
},
|
||||||
&common.StepOutputDir{
|
&commonsteps.StepOutputDir{
|
||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
ResultKey: "iso_path",
|
ResultKey: "iso_path",
|
||||||
@ -245,12 +246,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
TargetPath: b.config.TargetPath,
|
TargetPath: b.config.TargetPath,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyFiles,
|
Files: b.config.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -295,7 +296,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
||||||
Generation: b.config.Generation,
|
Generation: b.config.Generation,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -338,10 +339,10 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
|
|
||||||
// provision requires communicator to be setup
|
// provision requires communicator to be setup
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
|
|
||||||
// Remove ephemeral SSH keys, if using
|
// Remove ephemeral SSH keys, if using
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.SSHConfig.Comm,
|
Comm: &b.config.SSHConfig.Comm,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -377,7 +378,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
// the clean up actions for each step will be executed reverse order
|
// the clean up actions for each step will be executed reverse order
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -70,7 +70,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: instanceHost,
|
Host: instanceHost,
|
||||||
},
|
},
|
||||||
|
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
|
|
||||||
&stepStopJDCloudInstance{
|
&stepStopJDCloudInstance{
|
||||||
InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig,
|
InstanceSpecConfig: &b.config.JDCloudInstanceSpecConfig,
|
||||||
@ -81,7 +81,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -9,9 +9,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/linode/linodego"
|
"github.com/linode/linodego"
|
||||||
|
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -62,15 +62,15 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (ret
|
|||||||
Host: commHost(b.config.Comm.Host()),
|
Host: commHost(b.config.Comm.Host()),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
&stepShutdownLinode{client},
|
&stepShutdownLinode{client},
|
||||||
&stepCreateImage{client},
|
&stepCreateImage{client},
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
@ -59,7 +59,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("wrappedCommand", CommandWrapper(wrappedCommand))
|
state.Put("wrappedCommand", CommandWrapper(wrappedCommand))
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -28,7 +28,7 @@ func (s *StepProvision) Run(ctx context.Context, state multistep.StateBag) multi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loads hook data from builder's state, if it has been set.
|
// Loads hook data from builder's state, if it has been set.
|
||||||
hookData := common.PopulateProvisionHookData(state)
|
hookData := commonsteps.PopulateProvisionHookData(state)
|
||||||
|
|
||||||
// Update state generated_data with complete hookData
|
// Update state generated_data with complete hookData
|
||||||
// to make them accessible by post-processors
|
// to make them accessible by post-processors
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
@ -53,7 +53,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("wrappedCommand", CommandWrapper(wrappedCommand))
|
state.Put("wrappedCommand", CommandWrapper(wrappedCommand))
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -25,7 +25,7 @@ func (s *StepProvision) Run(ctx context.Context, state multistep.StateBag) multi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loads hook data from builder's state, if it has been set.
|
// Loads hook data from builder's state, if it has been set.
|
||||||
hookData := common.PopulateProvisionHookData(state)
|
hookData := commonsteps.PopulateProvisionHookData(state)
|
||||||
|
|
||||||
// Update state generated_data with complete hookData
|
// Update state generated_data with complete hookData
|
||||||
// to make them accessible by post-processors
|
// to make them accessible by post-processors
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -65,8 +65,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
NewStepStopServerInstance(conn, ui),
|
NewStepStopServerInstance(conn, ui),
|
||||||
@ -94,7 +94,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
NewStepStopServerInstance(conn, ui),
|
NewStepStopServerInstance(conn, ui),
|
||||||
NewStepCreateServerImage(conn, ui, &b.config),
|
NewStepCreateServerImage(conn, ui, &b.config),
|
||||||
NewStepDeleteBlockStorageInstance(conn, ui, &b.config),
|
NewStepDeleteBlockStorageInstance(conn, ui, &b.config),
|
||||||
@ -103,7 +103,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, b.stateBag)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, b.stateBag)
|
||||||
b.runner.Run(ctx, b.stateBag)
|
b.runner.Run(ctx, b.stateBag)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -40,7 +40,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
)
|
)
|
||||||
|
|
||||||
steps = append(steps,
|
steps = append(steps,
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Setup the state bag and initial state for the steps
|
// Setup the state bag and initial state for the steps
|
||||||
@ -50,7 +50,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("instance_id", "Null")
|
state.Put("instance_id", "Null")
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -49,14 +49,14 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "server_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "server_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
new(stepTakeSnapshot),
|
new(stepTakeSnapshot),
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -155,8 +156,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
b.config.SSHIPVersion),
|
b.config.SSHIPVersion),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&StepStopServer{},
|
&StepStopServer{},
|
||||||
@ -173,7 +174,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
"github.com/hashicorp/go-oracle-terraform/opc"
|
"github.com/hashicorp/go-oracle-terraform/opc"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
ocommon "github.com/hashicorp/packer/builder/oracle/common"
|
ocommon "github.com/hashicorp/packer/builder/oracle/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -106,7 +106,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "instance_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "instance_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&stepTerminatePVMaster{},
|
&stepTerminatePVMaster{},
|
||||||
&stepSecurity{
|
&stepSecurity{
|
||||||
SecurityListKey: "security_list_builder",
|
SecurityListKey: "security_list_builder",
|
||||||
@ -142,7 +142,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
&stepCreateImage{},
|
&stepCreateImage{},
|
||||||
&stepListImages{},
|
&stepListImages{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -169,8 +169,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "instance_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "instance_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
&stepSnapshot{},
|
&stepSnapshot{},
|
||||||
@ -179,7 +179,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps
|
// Run the steps
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
ocommon "github.com/hashicorp/packer/builder/oracle/common"
|
ocommon "github.com/hashicorp/packer/builder/oracle/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -70,15 +70,15 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "instance_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "instance_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
&stepImage{},
|
&stepImage{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps
|
// Run the steps
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -163,8 +164,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
b.config.SSHInterface),
|
b.config.SSHInterface),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&osccommon.StepStopBSUBackedVm{
|
&osccommon.StepStopBSUBackedVm{
|
||||||
@ -194,7 +195,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -185,8 +186,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
b.config.SSHInterface),
|
b.config.SSHInterface),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&osccommon.StepStopBSUBackedVm{
|
&osccommon.StepStopBSUBackedVm{
|
||||||
@ -221,7 +222,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -173,8 +174,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
b.config.SSHInterface),
|
b.config.SSHInterface),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.RunConfig.Comm,
|
Comm: &b.config.RunConfig.Comm,
|
||||||
},
|
},
|
||||||
&osccommon.StepStopBSUBackedVm{
|
&osccommon.StepStopBSUBackedVm{
|
||||||
@ -184,7 +185,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
osccommon "github.com/hashicorp/packer/builder/osc/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -278,7 +279,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -26,7 +26,7 @@ func (s *StepChrootProvision) Run(ctx context.Context, state multistep.StateBag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loads hook data from builder's state, if it has been set.
|
// Loads hook data from builder's state, if it has been set.
|
||||||
hookData := common.PopulateProvisionHookData(state)
|
hookData := commonsteps.PopulateProvisionHookData(state)
|
||||||
|
|
||||||
// Update state generated_data with complete hookData
|
// Update state generated_data with complete hookData
|
||||||
// to make them accessible by post-processors
|
// to make them accessible by post-processors
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -29,9 +30,9 @@ type Builder struct {
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
parallelscommon.OutputConfig `mapstructure:",squash"`
|
parallelscommon.OutputConfig `mapstructure:",squash"`
|
||||||
parallelscommon.HWConfig `mapstructure:",squash"`
|
parallelscommon.HWConfig `mapstructure:",squash"`
|
||||||
@ -191,7 +192,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
ParallelsToolsFlavor: b.config.ParallelsToolsFlavor,
|
ParallelsToolsFlavor: b.config.ParallelsToolsFlavor,
|
||||||
ParallelsToolsMode: b.config.ParallelsToolsMode,
|
ParallelsToolsMode: b.config.ParallelsToolsMode,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
@ -203,12 +204,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -249,8 +250,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
ParallelsToolsMode: b.config.ParallelsToolsMode,
|
ParallelsToolsMode: b.config.ParallelsToolsMode,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.SSHConfig.Comm,
|
Comm: &b.config.SSHConfig.Comm,
|
||||||
},
|
},
|
||||||
¶llelscommon.StepShutdown{
|
¶llelscommon.StepShutdown{
|
||||||
@ -275,7 +276,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("ui", ui)
|
state.Put("ui", ui)
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -59,7 +59,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
@ -99,12 +99,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
ParallelsToolsMode: b.config.ParallelsToolsMode,
|
ParallelsToolsMode: b.config.ParallelsToolsMode,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
¶llelscommon.StepShutdown{
|
¶llelscommon.StepShutdown{
|
||||||
Command: b.config.ShutdownCommand,
|
Command: b.config.ShutdownCommand,
|
||||||
Timeout: b.config.ShutdownTimeout,
|
Timeout: b.config.ShutdownTimeout,
|
||||||
},
|
},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.SSHConfig.Comm,
|
Comm: &b.config.SSHConfig.Comm,
|
||||||
},
|
},
|
||||||
¶llelscommon.StepPrlctl{
|
¶llelscommon.StepPrlctl{
|
||||||
@ -117,7 +117,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -19,7 +20,7 @@ import (
|
|||||||
// Config is the configuration structure for the builder.
|
// Config is the configuration structure for the builder.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
parallelscommon.OutputConfig `mapstructure:",squash"`
|
parallelscommon.OutputConfig `mapstructure:",squash"`
|
||||||
parallelscommon.PrlctlConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlConfig `mapstructure:",squash"`
|
||||||
parallelscommon.PrlctlPostConfig `mapstructure:",squash"`
|
parallelscommon.PrlctlPostConfig `mapstructure:",squash"`
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -46,8 +46,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "server_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "server_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
new(stepTakeSnapshot),
|
new(stepTakeSnapshot),
|
||||||
@ -55,7 +55,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
|
|
||||||
config := state.Get("config").(*Config)
|
config := state.Get("config").(*Config)
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Telmate/proxmox-api-go/proxmox"
|
"github.com/Telmate/proxmox-api-go/proxmox"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -61,7 +61,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook, state
|
|||||||
&stepStartVM{
|
&stepStartVM{
|
||||||
vmCreator: b.vmCreator,
|
vmCreator: b.vmCreator,
|
||||||
},
|
},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -76,8 +76,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook, state
|
|||||||
Host: commHost((*comm).Host()),
|
Host: commHost((*comm).Host()),
|
||||||
SSHConfig: (*comm).SSHConfigFunc(),
|
SSHConfig: (*comm).SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
&stepConvertToTemplate{},
|
&stepConvertToTemplate{},
|
||||||
@ -87,7 +87,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook, state
|
|||||||
steps := append(b.preSteps, coreSteps...)
|
steps := append(b.preSteps, coreSteps...)
|
||||||
steps = append(steps, b.postSteps...)
|
steps = append(steps, b.postSteps...)
|
||||||
// Run the steps
|
// Run the steps
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
"github.com/hashicorp/packer/common/uuid"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
@ -23,7 +24,7 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
BootKeyInterval time.Duration `mapstructure:"boot_key_interval"`
|
BootKeyInterval time.Duration `mapstructure:"boot_key_interval"`
|
||||||
Comm communicator.Config `mapstructure:",squash"`
|
Comm communicator.Config `mapstructure:",squash"`
|
||||||
@ -66,7 +67,7 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type storageConfig struct {
|
type storageConfig struct {
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
Device string `mapstructure:"device"`
|
Device string `mapstructure:"device"`
|
||||||
ISOFile string `mapstructure:"iso_file"`
|
ISOFile string `mapstructure:"iso_file"`
|
||||||
ISOStoragePool string `mapstructure:"iso_storage_pool"`
|
ISOStoragePool string `mapstructure:"iso_storage_pool"`
|
||||||
@ -133,9 +134,9 @@ func (c *Config) Prepare(upper interface{}, raws ...interface{}) ([]string, []st
|
|||||||
if c.Password == "" {
|
if c.Password == "" {
|
||||||
c.Password = os.Getenv("PROXMOX_PASSWORD")
|
c.Password = os.Getenv("PROXMOX_PASSWORD")
|
||||||
}
|
}
|
||||||
if c.BootKeyInterval == 0 && os.Getenv(common.PackerKeyEnv) != "" {
|
if c.BootKeyInterval == 0 && os.Getenv(bootcommand.PackerKeyEnv) != "" {
|
||||||
var err error
|
var err error
|
||||||
c.BootKeyInterval, err = time.ParseDuration(os.Getenv(common.PackerKeyEnv))
|
c.BootKeyInterval, err = time.ParseDuration(os.Getenv(bootcommand.PackerKeyEnv))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errs = packer.MultiErrorAppend(errs, err)
|
errs = packer.MultiErrorAppend(errs, err)
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
proxmoxapi "github.com/Telmate/proxmox-api-go/proxmox"
|
proxmoxapi "github.com/Telmate/proxmox-api-go/proxmox"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
proxmox "github.com/hashicorp/packer/builder/proxmox/common"
|
proxmox "github.com/hashicorp/packer/builder/proxmox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -34,7 +34,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("iso-config", &b.config)
|
state.Put("iso-config", &b.config)
|
||||||
|
|
||||||
preSteps := []multistep.Step{
|
preSteps := []multistep.Step{
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
@ -44,7 +44,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
for idx := range b.config.AdditionalISOFiles {
|
for idx := range b.config.AdditionalISOFiles {
|
||||||
preSteps = append(preSteps, &common.StepDownload{
|
preSteps = append(preSteps, &commonsteps.StepDownload{
|
||||||
Checksum: b.config.AdditionalISOFiles[idx].ISOChecksum,
|
Checksum: b.config.AdditionalISOFiles[idx].ISOChecksum,
|
||||||
Description: "additional ISO",
|
Description: "additional ISO",
|
||||||
Extension: b.config.AdditionalISOFiles[idx].TargetExtension,
|
Extension: b.config.AdditionalISOFiles[idx].TargetExtension,
|
||||||
|
@ -10,14 +10,14 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
proxmox "github.com/hashicorp/packer/builder/proxmox/common"
|
proxmox "github.com/hashicorp/packer/builder/proxmox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
proxmox.Config `mapstructure:",squash"`
|
proxmox.Config `mapstructure:",squash"`
|
||||||
|
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
ISOFile string `mapstructure:"iso_file"`
|
ISOFile string `mapstructure:"iso_file"`
|
||||||
ISOStoragePool string `mapstructure:"iso_storage_pool"`
|
ISOStoragePool string `mapstructure:"iso_storage_pool"`
|
||||||
UnmountISO bool `mapstructure:"unmount_iso"`
|
UnmountISO bool `mapstructure:"unmount_iso"`
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -51,7 +51,7 @@ func TestUploadISO(t *testing.T) {
|
|||||||
builderConfig: &Config{
|
builderConfig: &Config{
|
||||||
shouldUploadISO: true,
|
shouldUploadISO: true,
|
||||||
ISOStoragePool: "local",
|
ISOStoragePool: "local",
|
||||||
ISOConfig: common.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
ISOConfig: commonsteps.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
||||||
},
|
},
|
||||||
downloadPath: "testdata/test.iso",
|
downloadPath: "testdata/test.iso",
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ func TestUploadISO(t *testing.T) {
|
|||||||
builderConfig: &Config{
|
builderConfig: &Config{
|
||||||
shouldUploadISO: true,
|
shouldUploadISO: true,
|
||||||
ISOStoragePool: "local",
|
ISOStoragePool: "local",
|
||||||
ISOConfig: common.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
ISOConfig: commonsteps.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
||||||
},
|
},
|
||||||
downloadPath: "testdata/test.iso",
|
downloadPath: "testdata/test.iso",
|
||||||
failUpload: true,
|
failUpload: true,
|
||||||
@ -78,7 +78,7 @@ func TestUploadISO(t *testing.T) {
|
|||||||
builderConfig: &Config{
|
builderConfig: &Config{
|
||||||
shouldUploadISO: true,
|
shouldUploadISO: true,
|
||||||
ISOStoragePool: "local",
|
ISOStoragePool: "local",
|
||||||
ISOConfig: common.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
ISOConfig: commonsteps.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
||||||
},
|
},
|
||||||
|
|
||||||
expectError: true,
|
expectError: true,
|
||||||
@ -90,7 +90,7 @@ func TestUploadISO(t *testing.T) {
|
|||||||
builderConfig: &Config{
|
builderConfig: &Config{
|
||||||
shouldUploadISO: true,
|
shouldUploadISO: true,
|
||||||
ISOStoragePool: "local",
|
ISOStoragePool: "local",
|
||||||
ISOConfig: common.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
ISOConfig: commonsteps.ISOConfig{ISOUrls: []string{"http://server.example/some-file.iso"}},
|
||||||
},
|
},
|
||||||
downloadPath: "testdata/non-existent.iso",
|
downloadPath: "testdata/non-existent.iso",
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -43,7 +43,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
|
|
||||||
steps := []multistep.Step{}
|
steps := []multistep.Step{}
|
||||||
if !b.config.ISOSkipCache {
|
if !b.config.ISOSkipCache {
|
||||||
steps = append(steps, &common.StepDownload{
|
steps = append(steps, &commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
@ -59,12 +59,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
steps = append(steps, new(stepPrepareOutputDir),
|
steps = append(steps, new(stepPrepareOutputDir),
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -96,7 +96,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
QemuImgArgs: b.config.QemuImgArgs,
|
QemuImgArgs: b.config.QemuImgArgs,
|
||||||
},
|
},
|
||||||
new(stepHTTPIPDiscover),
|
new(stepHTTPIPDiscover),
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -126,8 +126,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
SSHPort: commPort,
|
SSHPort: commPort,
|
||||||
WinRMPort: commPort,
|
WinRMPort: commPort,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.CommConfig.Comm,
|
Comm: &b.config.CommConfig.Comm,
|
||||||
},
|
},
|
||||||
&stepShutdown{
|
&stepShutdown{
|
||||||
@ -154,7 +154,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("ui", ui)
|
state.Put("ui", ui)
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -65,13 +66,13 @@ type QemuImgArgs struct {
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
bootcommand.VNCConfig `mapstructure:",squash"`
|
bootcommand.VNCConfig `mapstructure:",squash"`
|
||||||
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
shutdowncommand.ShutdownConfig `mapstructure:",squash"`
|
||||||
CommConfig CommConfig `mapstructure:",squash"`
|
CommConfig CommConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
// Use iso from provided url. Qemu must support
|
// Use iso from provided url. Qemu must support
|
||||||
// curl block device. This defaults to `false`.
|
// curl block device. This defaults to `false`.
|
||||||
ISOSkipCache bool `mapstructure:"iso_skip_cache" required:"false"`
|
ISOSkipCache bool `mapstructure:"iso_skip_cache" required:"false"`
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -40,7 +40,7 @@ func Test_UserOverrides(t *testing.T) {
|
|||||||
testcases := []testCase{
|
testcases := []testCase{
|
||||||
{
|
{
|
||||||
&Config{
|
&Config{
|
||||||
HTTPConfig: common.HTTPConfig{
|
HTTPConfig: commonsteps.HTTPConfig{
|
||||||
HTTPDir: "http/directory",
|
HTTPDir: "http/directory",
|
||||||
},
|
},
|
||||||
OutputDir: "output/directory",
|
OutputDir: "output/directory",
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -82,8 +82,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: communicator.CommHost(b.config.Comm.Host(), "server_ip"),
|
Host: communicator.CommHost(b.config.Comm.Host(), "server_ip"),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Comm,
|
Comm: &b.config.Comm,
|
||||||
},
|
},
|
||||||
new(stepShutdown),
|
new(stepShutdown),
|
||||||
@ -91,7 +91,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
new(stepImage),
|
new(stepImage),
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -123,8 +124,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
SSHConfig: b.config.TencentCloudRunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.TencentCloudRunConfig.Comm.SSHConfigFunc(),
|
||||||
Host: SSHHost(b.config.AssociatePublicIpAddress),
|
Host: SSHHost(b.config.AssociatePublicIpAddress),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.TencentCloudRunConfig.Comm,
|
Comm: &b.config.TencentCloudRunConfig.Comm,
|
||||||
},
|
},
|
||||||
// We need this step to detach keypair from instance, otherwise
|
// We need this step to detach keypair from instance, otherwise
|
||||||
@ -140,7 +141,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -71,8 +71,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: commHost(b.config.Comm.Host()),
|
Host: commHost(b.config.Comm.Host()),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &config.Comm,
|
Comm: &config.Comm,
|
||||||
},
|
},
|
||||||
&StepStopMachine{},
|
&StepStopMachine{},
|
||||||
@ -80,7 +80,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&StepDeleteMachine{},
|
&StepDeleteMachine{},
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
ucloudcommon "github.com/hashicorp/packer/builder/ucloud/common"
|
ucloudcommon "github.com/hashicorp/packer/builder/ucloud/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -125,7 +126,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
b.config.UseSSHPrivateIp),
|
b.config.UseSSHPrivateIp),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&stepStopInstance{},
|
&stepStopInstance{},
|
||||||
&stepCreateImage{},
|
&stepCreateImage{},
|
||||||
&stepCopyUCloudImage{
|
&stepCopyUCloudImage{
|
||||||
@ -137,7 +138,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -32,9 +33,9 @@ type Builder struct {
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
|
|
||||||
Comm communicator.Config `mapstructure:",squash"`
|
Comm communicator.Config `mapstructure:",squash"`
|
||||||
@ -298,7 +299,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
steps := []multistep.Step{}
|
steps := []multistep.Step{}
|
||||||
// Download if source box isn't from vagrant cloud.
|
// Download if source box isn't from vagrant cloud.
|
||||||
if strings.HasSuffix(b.config.SourceBox, ".box") {
|
if strings.HasSuffix(b.config.SourceBox, ".box") {
|
||||||
steps = append(steps, &common.StepDownload{
|
steps = append(steps, &commonsteps.StepDownload{
|
||||||
Checksum: b.config.Checksum,
|
Checksum: b.config.Checksum,
|
||||||
Description: "Box",
|
Description: "Box",
|
||||||
Extension: "box",
|
Extension: "box",
|
||||||
@ -307,7 +308,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
steps = append(steps,
|
steps = append(steps,
|
||||||
&common.StepOutputDir{
|
&commonsteps.StepOutputDir{
|
||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
@ -347,7 +348,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: CommHost(),
|
Host: CommHost(),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&StepPackage{
|
&StepPackage{
|
||||||
SkipPackage: b.config.SkipPackage,
|
SkipPackage: b.config.SkipPackage,
|
||||||
Include: b.config.PackageInclude,
|
Include: b.config.PackageInclude,
|
||||||
@ -356,7 +357,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
@ -121,7 +121,7 @@ func (s *StepDownloadGuestAdditions) Run(ctx context.Context, state multistep.St
|
|||||||
log.Printf("Guest additions URL: %s", url)
|
log.Printf("Guest additions URL: %s", url)
|
||||||
|
|
||||||
// We're good, so let's go ahead and download this thing..
|
// We're good, so let's go ahead and download this thing..
|
||||||
downStep := &common.StepDownload{
|
downStep := &commonsteps.StepDownload{
|
||||||
Checksum: checksum,
|
Checksum: checksum,
|
||||||
Description: "Guest additions",
|
Description: "Guest additions",
|
||||||
ResultKey: "guest_additions_path",
|
ResultKey: "guest_additions_path",
|
||||||
@ -151,7 +151,7 @@ func (s *StepDownloadGuestAdditions) downloadAdditionsSHA256(ctx context.Context
|
|||||||
defer os.Remove(checksumsFile.Name())
|
defer os.Remove(checksumsFile.Name())
|
||||||
checksumsFile.Close()
|
checksumsFile.Close()
|
||||||
|
|
||||||
downStep := &common.StepDownload{
|
downStep := &commonsteps.StepDownload{
|
||||||
Description: "Guest additions checksums",
|
Description: "Guest additions checksums",
|
||||||
ResultKey: "guest_additions_checksums_path",
|
ResultKey: "guest_additions_checksums_path",
|
||||||
Url: []string{checksumsUrl},
|
Url: []string{checksumsUrl},
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -28,10 +29,10 @@ type Builder struct {
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
vboxcommon.ExportConfig `mapstructure:",squash"`
|
vboxcommon.ExportConfig `mapstructure:",squash"`
|
||||||
vboxcommon.OutputConfig `mapstructure:",squash"`
|
vboxcommon.OutputConfig `mapstructure:",squash"`
|
||||||
@ -243,7 +244,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsSHA256: b.config.GuestAdditionsSHA256,
|
GuestAdditionsSHA256: b.config.GuestAdditionsSHA256,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
@ -251,21 +252,21 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
TargetPath: b.config.TargetPath,
|
TargetPath: b.config.TargetPath,
|
||||||
Url: b.config.ISOUrls,
|
Url: b.config.ISOUrls,
|
||||||
},
|
},
|
||||||
&common.StepOutputDir{
|
&commonsteps.StepOutputDir{
|
||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
new(vboxcommon.StepHTTPIPDiscover),
|
new(vboxcommon.StepHTTPIPDiscover),
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -327,8 +328,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.CommConfig.Comm,
|
Comm: &b.config.CommConfig.Comm,
|
||||||
},
|
},
|
||||||
&vboxcommon.StepShutdown{
|
&vboxcommon.StepShutdown{
|
||||||
@ -365,7 +366,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
state.Put("ui", ui)
|
state.Put("ui", ui)
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -50,22 +50,22 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
|
|
||||||
// Build the steps.
|
// Build the steps.
|
||||||
steps := []multistep.Step{
|
steps := []multistep.Step{
|
||||||
&common.StepOutputDir{
|
&commonsteps.StepOutputDir{
|
||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
},
|
},
|
||||||
new(vboxcommon.StepSuppressMessages),
|
new(vboxcommon.StepSuppressMessages),
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
new(vboxcommon.StepHTTPIPDiscover),
|
new(vboxcommon.StepHTTPIPDiscover),
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -82,7 +82,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsSHA256: b.config.GuestAdditionsSHA256,
|
GuestAdditionsSHA256: b.config.GuestAdditionsSHA256,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.Checksum,
|
Checksum: b.config.Checksum,
|
||||||
Description: "OVF/OVA",
|
Description: "OVF/OVA",
|
||||||
Extension: "ova",
|
Extension: "ova",
|
||||||
@ -143,8 +143,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.CommConfig.Comm,
|
Comm: &b.config.CommConfig.Comm,
|
||||||
},
|
},
|
||||||
&vboxcommon.StepShutdown{
|
&vboxcommon.StepShutdown{
|
||||||
@ -170,7 +170,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
@ -17,9 +18,9 @@ import (
|
|||||||
// Config is the configuration structure for the builder.
|
// Config is the configuration structure for the builder.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
vboxcommon.ExportConfig `mapstructure:",squash"`
|
vboxcommon.ExportConfig `mapstructure:",squash"`
|
||||||
vboxcommon.OutputConfig `mapstructure:",squash"`
|
vboxcommon.OutputConfig `mapstructure:",squash"`
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -50,11 +50,11 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
// Build the steps.
|
// Build the steps.
|
||||||
steps := []multistep.Step{
|
steps := []multistep.Step{
|
||||||
new(vboxcommon.StepSuppressMessages),
|
new(vboxcommon.StepSuppressMessages),
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -64,7 +64,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
KeepRegistered: b.config.KeepRegistered,
|
KeepRegistered: b.config.KeepRegistered,
|
||||||
},
|
},
|
||||||
new(vboxcommon.StepHTTPIPDiscover),
|
new(vboxcommon.StepHTTPIPDiscover),
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -127,8 +127,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
GuestAdditionsPath: b.config.GuestAdditionsPath,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
new(common.StepProvision),
|
new(commonsteps.StepProvision),
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.CommConfig.Comm,
|
Comm: &b.config.CommConfig.Comm,
|
||||||
},
|
},
|
||||||
&vboxcommon.StepShutdown{
|
&vboxcommon.StepShutdown{
|
||||||
@ -160,13 +160,13 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
if !b.config.SkipExport {
|
if !b.config.SkipExport {
|
||||||
steps = append(steps, nil)
|
steps = append(steps, nil)
|
||||||
copy(steps[1:], steps)
|
copy(steps[1:], steps)
|
||||||
steps[0] = &common.StepOutputDir{
|
steps[0] = &commonsteps.StepOutputDir{
|
||||||
Force: b.config.PackerForce,
|
Force: b.config.PackerForce,
|
||||||
Path: b.config.OutputDir,
|
Path: b.config.OutputDir,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
vboxcommon "github.com/hashicorp/packer/builder/virtualbox/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
@ -19,9 +20,9 @@ import (
|
|||||||
// Config is the configuration structure for the builder.
|
// Config is the configuration structure for the builder.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
bootcommand.BootConfig `mapstructure:",squash"`
|
bootcommand.BootConfig `mapstructure:",squash"`
|
||||||
vboxcommon.ExportConfig `mapstructure:",squash"`
|
vboxcommon.ExportConfig `mapstructure:",squash"`
|
||||||
vboxcommon.OutputConfig `mapstructure:",squash"`
|
vboxcommon.OutputConfig `mapstructure:",squash"`
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -57,7 +57,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
RemoteType: b.config.RemoteType,
|
RemoteType: b.config.RemoteType,
|
||||||
ToolsUploadFlavor: b.config.ToolsUploadFlavor,
|
ToolsUploadFlavor: b.config.ToolsUploadFlavor,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
@ -71,12 +71,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
RemoteType: b.config.RemoteType,
|
RemoteType: b.config.RemoteType,
|
||||||
VMName: b.config.VMName,
|
VMName: b.config.VMName,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -117,7 +117,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
&vmwcommon.StepSuppressMessages{},
|
&vmwcommon.StepSuppressMessages{},
|
||||||
&vmwcommon.StepHTTPIPDiscover{},
|
&vmwcommon.StepHTTPIPDiscover{},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -161,8 +161,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
ToolsUploadPath: b.config.ToolsUploadPath,
|
ToolsUploadPath: b.config.ToolsUploadPath,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.SSHConfig.Comm,
|
Comm: &b.config.SSHConfig.Comm,
|
||||||
},
|
},
|
||||||
&vmwcommon.StepShutdown{
|
&vmwcommon.StepShutdown{
|
||||||
@ -196,7 +196,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run!
|
// Run!
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// If there was an error, return that
|
// If there was an error, return that
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -20,10 +21,10 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
bootcommand.VNCConfig `mapstructure:",squash"`
|
bootcommand.VNCConfig `mapstructure:",squash"`
|
||||||
vmwcommon.DriverConfig `mapstructure:",squash"`
|
vmwcommon.DriverConfig `mapstructure:",squash"`
|
||||||
vmwcommon.HWConfig `mapstructure:",squash"`
|
vmwcommon.HWConfig `mapstructure:",squash"`
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -68,12 +68,12 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
RemoteType: b.config.RemoteType,
|
RemoteType: b.config.RemoteType,
|
||||||
VMName: b.config.VMName,
|
VMName: b.config.VMName,
|
||||||
},
|
},
|
||||||
&common.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyConfig.FloppyFiles,
|
Files: b.config.FloppyConfig.FloppyFiles,
|
||||||
Directories: b.config.FloppyConfig.FloppyDirectories,
|
Directories: b.config.FloppyConfig.FloppyDirectories,
|
||||||
Label: b.config.FloppyConfig.FloppyLabel,
|
Label: b.config.FloppyConfig.FloppyLabel,
|
||||||
},
|
},
|
||||||
&common.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -107,7 +107,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
},
|
},
|
||||||
&vmwcommon.StepSuppressMessages{},
|
&vmwcommon.StepSuppressMessages{},
|
||||||
&vmwcommon.StepHTTPIPDiscover{},
|
&vmwcommon.StepHTTPIPDiscover{},
|
||||||
&common.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -154,8 +154,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
ToolsUploadPath: b.config.ToolsUploadPath,
|
ToolsUploadPath: b.config.ToolsUploadPath,
|
||||||
Ctx: b.config.ctx,
|
Ctx: b.config.ctx,
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.SSHConfig.Comm,
|
Comm: &b.config.SSHConfig.Comm,
|
||||||
},
|
},
|
||||||
&vmwcommon.StepShutdown{
|
&vmwcommon.StepShutdown{
|
||||||
@ -189,7 +189,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps.
|
// Run the steps.
|
||||||
b.runner = common.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors.
|
// Report any errors.
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/common/bootcommand"
|
"github.com/hashicorp/packer/common/bootcommand"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/shutdowncommand"
|
"github.com/hashicorp/packer/common/shutdowncommand"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -19,10 +20,10 @@ import (
|
|||||||
// Config is the configuration structure for the builder.
|
// Config is the configuration structure for the builder.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
common.PackerConfig `mapstructure:",squash"`
|
common.PackerConfig `mapstructure:",squash"`
|
||||||
common.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
common.FloppyConfig `mapstructure:",squash"`
|
commonsteps.FloppyConfig `mapstructure:",squash"`
|
||||||
bootcommand.VNCConfig `mapstructure:",squash"`
|
bootcommand.VNCConfig `mapstructure:",squash"`
|
||||||
common.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
vmwcommon.DriverConfig `mapstructure:",squash"`
|
vmwcommon.DriverConfig `mapstructure:",squash"`
|
||||||
vmwcommon.OutputConfig `mapstructure:",squash"`
|
vmwcommon.OutputConfig `mapstructure:",squash"`
|
||||||
vmwcommon.RunConfig `mapstructure:",squash"`
|
vmwcommon.RunConfig `mapstructure:",squash"`
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/builder/vsphere/common"
|
"github.com/hashicorp/packer/builder/vsphere/common"
|
||||||
"github.com/hashicorp/packer/builder/vsphere/driver"
|
"github.com/hashicorp/packer/builder/vsphere/driver"
|
||||||
packerCommon "github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -41,7 +41,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&common.StepConnect{
|
&common.StepConnect{
|
||||||
Config: &b.config.ConnectConfig,
|
Config: &b.config.ConnectConfig,
|
||||||
},
|
},
|
||||||
&packerCommon.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -74,7 +74,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
|
|
||||||
if b.config.Comm.Type != "none" {
|
if b.config.Comm.Type != "none" {
|
||||||
steps = append(steps,
|
steps = append(steps,
|
||||||
&packerCommon.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyFiles,
|
Files: b.config.FloppyFiles,
|
||||||
Directories: b.config.FloppyDirectories,
|
Directories: b.config.FloppyDirectories,
|
||||||
Label: b.config.FloppyLabel,
|
Label: b.config.FloppyLabel,
|
||||||
@ -89,7 +89,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
HTTPIP: b.config.BootConfig.HTTPIP,
|
HTTPIP: b.config.BootConfig.HTTPIP,
|
||||||
Network: b.config.WaitIpConfig.GetIPNet(),
|
Network: b.config.WaitIpConfig.GetIPNet(),
|
||||||
},
|
},
|
||||||
&packerCommon.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -117,7 +117,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: common.CommHost(b.config.Comm.Host()),
|
Host: common.CommHost(b.config.Comm.Host()),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&packerCommon.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepShutdown{
|
&common.StepShutdown{
|
||||||
Config: &b.config.ShutdownConfig,
|
Config: &b.config.ShutdownConfig,
|
||||||
},
|
},
|
||||||
@ -157,7 +157,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = packerCommon.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -6,6 +6,7 @@ package clone
|
|||||||
import (
|
import (
|
||||||
"github.com/hashicorp/packer/builder/vsphere/common"
|
"github.com/hashicorp/packer/builder/vsphere/common"
|
||||||
packerCommon "github.com/hashicorp/packer/common"
|
packerCommon "github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -14,8 +15,8 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
packerCommon.PackerConfig `mapstructure:",squash"`
|
packerCommon.PackerConfig `mapstructure:",squash"`
|
||||||
packerCommon.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
packerCommon.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
|
|
||||||
common.ConnectConfig `mapstructure:",squash"`
|
common.ConnectConfig `mapstructure:",squash"`
|
||||||
CloneConfig `mapstructure:",squash"`
|
CloneConfig `mapstructure:",squash"`
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/builder/vsphere/common"
|
"github.com/hashicorp/packer/builder/vsphere/common"
|
||||||
"github.com/hashicorp/packer/builder/vsphere/driver"
|
"github.com/hashicorp/packer/builder/vsphere/driver"
|
||||||
packerCommon "github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -41,7 +41,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Config: &b.config.ConnectConfig,
|
Config: &b.config.ConnectConfig,
|
||||||
},
|
},
|
||||||
&common.StepDownload{
|
&common.StepDownload{
|
||||||
DownloadStep: &packerCommon.StepDownload{
|
DownloadStep: &commonsteps.StepDownload{
|
||||||
Checksum: b.config.ISOChecksum,
|
Checksum: b.config.ISOChecksum,
|
||||||
Description: "ISO",
|
Description: "ISO",
|
||||||
Extension: b.config.TargetExtension,
|
Extension: b.config.TargetExtension,
|
||||||
@ -54,7 +54,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Datastore: b.config.Datastore,
|
Datastore: b.config.Datastore,
|
||||||
Host: b.config.Host,
|
Host: b.config.Host,
|
||||||
},
|
},
|
||||||
&packerCommon.StepCreateCD{
|
&commonsteps.StepCreateCD{
|
||||||
Files: b.config.CDConfig.CDFiles,
|
Files: b.config.CDConfig.CDFiles,
|
||||||
Label: b.config.CDConfig.CDLabel,
|
Label: b.config.CDConfig.CDLabel,
|
||||||
},
|
},
|
||||||
@ -77,7 +77,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
&common.StepConfigParams{
|
&common.StepConfigParams{
|
||||||
Config: &b.config.ConfigParamsConfig,
|
Config: &b.config.ConfigParamsConfig,
|
||||||
},
|
},
|
||||||
&packerCommon.StepCreateFloppy{
|
&commonsteps.StepCreateFloppy{
|
||||||
Files: b.config.FloppyFiles,
|
Files: b.config.FloppyFiles,
|
||||||
Directories: b.config.FloppyDirectories,
|
Directories: b.config.FloppyDirectories,
|
||||||
Label: b.config.FloppyLabel,
|
Label: b.config.FloppyLabel,
|
||||||
@ -92,7 +92,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
HTTPIP: b.config.BootConfig.HTTPIP,
|
HTTPIP: b.config.BootConfig.HTTPIP,
|
||||||
Network: b.config.WaitIpConfig.GetIPNet(),
|
Network: b.config.WaitIpConfig.GetIPNet(),
|
||||||
},
|
},
|
||||||
&packerCommon.StepHTTPServer{
|
&commonsteps.StepHTTPServer{
|
||||||
HTTPDir: b.config.HTTPDir,
|
HTTPDir: b.config.HTTPDir,
|
||||||
HTTPPortMin: b.config.HTTPPortMin,
|
HTTPPortMin: b.config.HTTPPortMin,
|
||||||
HTTPPortMax: b.config.HTTPPortMax,
|
HTTPPortMax: b.config.HTTPPortMax,
|
||||||
@ -119,7 +119,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: common.CommHost(b.config.Comm.Host()),
|
Host: common.CommHost(b.config.Comm.Host()),
|
||||||
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&packerCommon.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
b.runner = packerCommon.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
if rawErr, ok := state.GetOk("error"); ok {
|
if rawErr, ok := state.GetOk("error"); ok {
|
||||||
|
@ -6,6 +6,7 @@ package iso
|
|||||||
import (
|
import (
|
||||||
"github.com/hashicorp/packer/builder/vsphere/common"
|
"github.com/hashicorp/packer/builder/vsphere/common"
|
||||||
packerCommon "github.com/hashicorp/packer/common"
|
packerCommon "github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/helper/config"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
@ -14,8 +15,8 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
packerCommon.PackerConfig `mapstructure:",squash"`
|
packerCommon.PackerConfig `mapstructure:",squash"`
|
||||||
packerCommon.HTTPConfig `mapstructure:",squash"`
|
commonsteps.HTTPConfig `mapstructure:",squash"`
|
||||||
packerCommon.CDConfig `mapstructure:",squash"`
|
commonsteps.CDConfig `mapstructure:",squash"`
|
||||||
|
|
||||||
common.ConnectConfig `mapstructure:",squash"`
|
common.ConnectConfig `mapstructure:",squash"`
|
||||||
CreateConfig `mapstructure:",squash"`
|
CreateConfig `mapstructure:",squash"`
|
||||||
@ -23,7 +24,7 @@ type Config struct {
|
|||||||
common.HardwareConfig `mapstructure:",squash"`
|
common.HardwareConfig `mapstructure:",squash"`
|
||||||
common.ConfigParamsConfig `mapstructure:",squash"`
|
common.ConfigParamsConfig `mapstructure:",squash"`
|
||||||
|
|
||||||
packerCommon.ISOConfig `mapstructure:",squash"`
|
commonsteps.ISOConfig `mapstructure:",squash"`
|
||||||
|
|
||||||
common.CDRomConfig `mapstructure:",squash"`
|
common.CDRomConfig `mapstructure:",squash"`
|
||||||
common.RemoveCDRomConfig `mapstructure:",squash"`
|
common.RemoveCDRomConfig `mapstructure:",squash"`
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
"github.com/hashicorp/packer/common/packerbuilderdata"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
@ -83,8 +83,8 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
Host: commHost,
|
Host: commHost,
|
||||||
SSHConfig: b.config.Communicator.SSHConfigFunc(),
|
SSHConfig: b.config.Communicator.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&commonsteps.StepProvision{},
|
||||||
&common.StepCleanupTempKeys{
|
&commonsteps.StepCleanupTempKeys{
|
||||||
Comm: &b.config.Communicator,
|
Comm: &b.config.Communicator,
|
||||||
},
|
},
|
||||||
&StepTeardownInstance{},
|
&StepTeardownInstance{},
|
||||||
@ -94,7 +94,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the steps
|
// Run the steps
|
||||||
b.runner = common.NewRunner(steps, b.config.PackerConfig, ui)
|
b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui)
|
||||||
b.runner.Run(ctx, state)
|
b.runner.Run(ctx, state)
|
||||||
|
|
||||||
// Report any errors
|
// Report any errors
|
||||||
|
@ -10,6 +10,15 @@ import (
|
|||||||
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// PackerKeyEnv is used to specify the key interval (delay) between keystrokes
|
||||||
|
// sent to the VM, typically in boot commands. This is to prevent host CPU
|
||||||
|
// utilization from causing key presses to be skipped or repeated incorrectly.
|
||||||
|
const PackerKeyEnv = "PACKER_KEY_INTERVAL"
|
||||||
|
|
||||||
|
// PackerKeyDefault 100ms is appropriate for shared build infrastructure while a
|
||||||
|
// shorter delay (e.g. 10ms) can be used on a workstation. See PackerKeyEnv.
|
||||||
|
const PackerKeyDefault = 100 * time.Millisecond
|
||||||
|
|
||||||
// The boot configuration is very important: `boot_command` specifies the keys
|
// The boot configuration is very important: `boot_command` specifies the keys
|
||||||
// to type when the virtual machine is first booted in order to start the OS
|
// to type when the virtual machine is first booted in order to start the OS
|
||||||
// installer. This command is typed after boot_wait, which gives the virtual
|
// installer. This command is typed after boot_wait, which gives the virtual
|
||||||
|
@ -8,8 +8,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// SendCodeFunc will be called to send codes to the VM
|
// SendCodeFunc will be called to send codes to the VM
|
||||||
@ -41,8 +39,8 @@ func (sc *scancode) makeBreak() []string {
|
|||||||
func NewPCXTDriver(send SendCodeFunc, chunkSize int, interval time.Duration) *pcXTDriver {
|
func NewPCXTDriver(send SendCodeFunc, chunkSize int, interval time.Duration) *pcXTDriver {
|
||||||
// We delay (default 100ms) between each input event to allow for CPU or
|
// We delay (default 100ms) between each input event to allow for CPU or
|
||||||
// network latency. See PackerKeyEnv for tuning.
|
// network latency. See PackerKeyEnv for tuning.
|
||||||
keyInterval := common.PackerKeyDefault
|
keyInterval := PackerKeyDefault
|
||||||
if delay, err := time.ParseDuration(os.Getenv(common.PackerKeyEnv)); err == nil {
|
if delay, err := time.ParseDuration(os.Getenv(PackerKeyEnv)); err == nil {
|
||||||
keyInterval = delay
|
keyInterval = delay
|
||||||
}
|
}
|
||||||
// Override interval based on builder-specific override
|
// Override interval based on builder-specific override
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"golang.org/x/mobile/event/key"
|
"golang.org/x/mobile/event/key"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -25,8 +24,8 @@ type usbDriver struct {
|
|||||||
func NewUSBDriver(send SendUsbScanCodes, interval time.Duration) *usbDriver {
|
func NewUSBDriver(send SendUsbScanCodes, interval time.Duration) *usbDriver {
|
||||||
// We delay (default 100ms) between each key event to allow for CPU or
|
// We delay (default 100ms) between each key event to allow for CPU or
|
||||||
// network latency. See PackerKeyEnv for tuning.
|
// network latency. See PackerKeyEnv for tuning.
|
||||||
keyInterval := common.PackerKeyDefault
|
keyInterval := PackerKeyDefault
|
||||||
if delay, err := time.ParseDuration(os.Getenv(common.PackerKeyEnv)); err == nil {
|
if delay, err := time.ParseDuration(os.Getenv(PackerKeyEnv)); err == nil {
|
||||||
keyInterval = delay
|
keyInterval = delay
|
||||||
}
|
}
|
||||||
// override interval based on builder-specific override.
|
// override interval based on builder-specific override.
|
||||||
|
@ -7,8 +7,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const KeyLeftShift uint32 = 0xFFE1
|
const KeyLeftShift uint32 = 0xFFE1
|
||||||
@ -28,8 +26,8 @@ type vncDriver struct {
|
|||||||
func NewVNCDriver(c VNCKeyEvent, interval time.Duration) *vncDriver {
|
func NewVNCDriver(c VNCKeyEvent, interval time.Duration) *vncDriver {
|
||||||
// We delay (default 100ms) between each key event to allow for CPU or
|
// We delay (default 100ms) between each key event to allow for CPU or
|
||||||
// network latency. See PackerKeyEnv for tuning.
|
// network latency. See PackerKeyEnv for tuning.
|
||||||
keyInterval := common.PackerKeyDefault
|
keyInterval := PackerKeyDefault
|
||||||
if delay, err := time.ParseDuration(os.Getenv(common.PackerKeyEnv)); err == nil {
|
if delay, err := time.ParseDuration(os.Getenv(PackerKeyEnv)); err == nil {
|
||||||
keyInterval = delay
|
keyInterval = delay
|
||||||
}
|
}
|
||||||
// override interval based on builder-specific override.
|
// override interval based on builder-specific override.
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/common"
|
||||||
|
"github.com/hashicorp/packer/common/commonsteps"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
@ -26,7 +27,7 @@ func (s *StepChrootProvision) Run(ctx context.Context, state multistep.StateBag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loads hook data from builder's state, if it has been set.
|
// Loads hook data from builder's state, if it has been set.
|
||||||
hookData := common.PopulateProvisionHookData(state)
|
hookData := commonsteps.PopulateProvisionHookData(state)
|
||||||
|
|
||||||
// Update state generated_data with complete hookData
|
// Update state generated_data with complete hookData
|
||||||
// to make them accessible by post-processors
|
// to make them accessible by post-processors
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//go:generate struct-markdown
|
//go:generate struct-markdown
|
||||||
|
|
||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
@ -1,6 +1,6 @@
|
|||||||
//go:generate struct-markdown
|
//go:generate struct-markdown
|
||||||
|
|
||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
@ -1,6 +1,6 @@
|
|||||||
//go:generate struct-markdown
|
//go:generate struct-markdown
|
||||||
|
|
||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
@ -1,6 +1,6 @@
|
|||||||
//go:generate struct-markdown
|
//go:generate struct-markdown
|
||||||
|
|
||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,6 +1,6 @@
|
|||||||
// +build !windows
|
// +build !windows
|
||||||
|
|
||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -8,11 +8,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/hashicorp/packer/common"
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newRunner(steps []multistep.Step, config PackerConfig, ui packer.Ui) (multistep.Runner, multistep.DebugPauseFn) {
|
func newRunner(steps []multistep.Step, config common.PackerConfig, ui packer.Ui) (multistep.Runner, multistep.DebugPauseFn) {
|
||||||
switch config.PackerOnError {
|
switch config.PackerOnError {
|
||||||
case "", "cleanup":
|
case "", "cleanup":
|
||||||
case "abort":
|
case "abort":
|
||||||
@ -47,7 +48,7 @@ func newRunner(steps []multistep.Step, config PackerConfig, ui packer.Ui) (multi
|
|||||||
|
|
||||||
// NewRunner returns a multistep.Runner that runs steps augmented with support
|
// NewRunner returns a multistep.Runner that runs steps augmented with support
|
||||||
// for -debug and -on-error command line arguments.
|
// for -debug and -on-error command line arguments.
|
||||||
func NewRunner(steps []multistep.Step, config PackerConfig, ui packer.Ui) multistep.Runner {
|
func NewRunner(steps []multistep.Step, config common.PackerConfig, ui packer.Ui) multistep.Runner {
|
||||||
runner, _ := newRunner(steps, config, ui)
|
runner, _ := newRunner(steps, config, ui)
|
||||||
return runner
|
return runner
|
||||||
}
|
}
|
||||||
@ -56,7 +57,7 @@ func NewRunner(steps []multistep.Step, config PackerConfig, ui packer.Ui) multis
|
|||||||
// with support for -debug and -on-error command line arguments. With -debug it
|
// with support for -debug and -on-error command line arguments. With -debug it
|
||||||
// puts the multistep.DebugPauseFn that will pause execution between steps into
|
// puts the multistep.DebugPauseFn that will pause execution between steps into
|
||||||
// the state under the key "pauseFn".
|
// the state under the key "pauseFn".
|
||||||
func NewRunnerWithPauseFn(steps []multistep.Step, config PackerConfig, ui packer.Ui, state multistep.StateBag) multistep.Runner {
|
func NewRunnerWithPauseFn(steps []multistep.Step, config common.PackerConfig, ui packer.Ui, state multistep.StateBag) multistep.Runner {
|
||||||
runner, pauseFn := newRunner(steps, config, ui)
|
runner, pauseFn := newRunner(steps, config, ui)
|
||||||
if pauseFn != nil {
|
if pauseFn != nil {
|
||||||
state.Put("pauseFn", pauseFn)
|
state.Put("pauseFn", pauseFn)
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package commonsteps
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user