Compare commits
10 Commits
master
...
separate_c
Author | SHA1 | Date |
---|---|---|
Megan Marsh | 0984f4698b | |
Megan Marsh | c9fbb10c6e | |
Megan Marsh | 203f9f764e | |
Megan Marsh | 12e1831b56 | |
Megan Marsh | fa65c04280 | |
Megan Marsh | 6dcd87a779 | |
Megan Marsh | 2eaaf7218b | |
Megan Marsh | 67e856aaca | |
Megan Marsh | 7be0cf428a | |
Megan Marsh | bfee3b8f5b |
|
@ -12,7 +12,7 @@ import (
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
"github.com/hashicorp/packer/builder/alicloud/version"
|
"github.com/hashicorp/packer/builder/alicloud/version"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
"github.com/mitchellh/go-homedir"
|
"github.com/mitchellh/go-homedir"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The unique ID for this builder
|
// The unique ID for this builder
|
||||||
|
@ -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
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
helperconfig "github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
helperconfig "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testBuilderConfig() map[string]interface{} {
|
func testBuilderConfig() map[string]interface{} {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The "AlicloudDiskDevice" object us used for the `ECSSystemDiskMapping` and
|
// The "AlicloudDiskDevice" object us used for the `ECSSystemDiskMapping` and
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"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/packer-plugin-sdk/config"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RunConfig struct {
|
type RunConfig struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepConfigAlicloudSecurityGroup struct {
|
type stepConfigAlicloudSecurityGroup struct {
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepConfigAlicloudVPC struct {
|
type stepConfigAlicloudVPC struct {
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepConfigAlicloudVSwitch struct {
|
type stepConfigAlicloudVSwitch struct {
|
||||||
|
|
|
@ -5,13 +5,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/random"
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepCreateAlicloudImage struct {
|
type stepCreateAlicloudImage struct {
|
||||||
|
|
|
@ -7,14 +7,14 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepCreateAlicloudInstance struct {
|
type stepCreateAlicloudInstance struct {
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepRegionCopyAlicloudImage struct {
|
type stepRegionCopyAlicloudImage struct {
|
||||||
|
|
|
@ -15,14 +15,15 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"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/chroot"
|
|
||||||
"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/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The unique ID for this builder
|
// The unique ID for this builder
|
||||||
|
@ -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
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCopyFile(t *testing.T) {
|
func TestCopyFile(t *testing.T) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package chroot
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/chroot"
|
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAttachVolumeCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
|
func TestAttachVolumeCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepCreateVolume creates a new volume from the snapshot of the root
|
// StepCreateVolume creates a new volume from the snapshot of the root
|
||||||
|
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/chroot"
|
|
||||||
"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/chroot"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepEarlyUnflock unlocks the flock.
|
// StepEarlyUnflock unlocks the flock.
|
||||||
|
|
|
@ -3,7 +3,7 @@ package chroot
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/chroot"
|
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFlockCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
|
func TestFlockCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
|
||||||
|
|
|
@ -10,11 +10,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type mountPathData struct {
|
type mountPathData struct {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package chroot
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/chroot"
|
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMountDeviceCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
|
func TestMountDeviceCleanupFunc_ImplementsCleanupFunc(t *testing.T) {
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"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/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepPrepareDevice finds an available device and sets it.
|
// StepPrepareDevice finds an available device and sets it.
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common/random"
|
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepRegisterAMI creates the AMI.
|
// StepRegisterAMI creates the AMI.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
amazon "github.com/hashicorp/packer/builder/amazon/common"
|
amazon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
awsbase "github.com/hashicorp/aws-sdk-go-base"
|
awsbase "github.com/hashicorp/aws-sdk-go-base"
|
||||||
cleanhttp "github.com/hashicorp/go-cleanhttp"
|
cleanhttp "github.com/hashicorp/go-cleanhttp"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
vaultapi "github.com/hashicorp/vault/api"
|
vaultapi "github.com/hashicorp/vault/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AMIConfig is for common configuration related to creating AMIs.
|
// AMIConfig is for common configuration related to creating AMIs.
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testAMIConfig() *AMIConfig {
|
func testAMIConfig() *AMIConfig {
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These will be attached when launching your instance. Your
|
// These will be attached when launching your instance. Your
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBlockDevice(t *testing.T) {
|
func TestBlockDevice(t *testing.T) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DestroyAMIs deregisters the AWS machine images in imageids from an active AWS account
|
// DestroyAMIs deregisters the AWS machine images in imageids from an active AWS account
|
||||||
|
|
|
@ -3,8 +3,8 @@ package common
|
||||||
import (
|
import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BuildInfoTemplate struct {
|
type BuildInfoTemplate struct {
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testImage() *ec2.Image {
|
func testImage() *ec2.Image {
|
||||||
|
|
|
@ -11,10 +11,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
var reShutdownBehavior = regexp.MustCompile("^(stop|terminate)$")
|
var reShutdownBehavior = regexp.MustCompile("^(stop|terminate)$")
|
||||||
|
|
|
@ -13,9 +13,9 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ssm"
|
"github.com/aws/aws-sdk-go/service/ssm"
|
||||||
"github.com/aws/aws-sdk-go/service/ssm/ssmiface"
|
"github.com/aws/aws-sdk-go/service/ssm/ssmiface"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"github.com/hashicorp/packer/common/shell-local/localexec"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/shell-local/localexec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepAMIRegionCopy struct {
|
type StepAMIRegionCopy struct {
|
||||||
|
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Define a mock struct to be used in unit tests for common aws steps.
|
// Define a mock struct to be used in unit tests for common aws steps.
|
||||||
|
|
|
@ -10,9 +10,9 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ssm"
|
"github.com/aws/aws-sdk-go/service/ssm"
|
||||||
pssm "github.com/hashicorp/packer/builder/amazon/common/ssm"
|
pssm "github.com/hashicorp/packer/builder/amazon/common/ssm"
|
||||||
"github.com/hashicorp/packer/common/net"
|
|
||||||
"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/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepCreateSSMTunnel struct {
|
type StepCreateSSMTunnel struct {
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepCreateTags struct {
|
type StepCreateTags struct {
|
||||||
|
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepGetPassword reads the password from a Windows server and sets it
|
// StepGetPassword reads the password from a Windows server and sets it
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/iam"
|
"github.com/aws/aws-sdk-go/service/iam"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepIamInstanceProfile struct {
|
type StepIamInstanceProfile struct {
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepKeyPair struct {
|
type StepKeyPair struct {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepModifyAMIAttributes struct {
|
type StepModifyAMIAttributes struct {
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepModifyEBSBackedInstance struct {
|
type StepModifyEBSBackedInstance struct {
|
||||||
|
|
|
@ -10,9 +10,9 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepPreValidate provides an opportunity to pre-validate any configuration for
|
// StepPreValidate provides an opportunity to pre-validate any configuration for
|
||||||
|
|
|
@ -12,11 +12,11 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepRunSourceInstance struct {
|
type StepRunSourceInstance struct {
|
||||||
|
|
|
@ -13,12 +13,12 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/random"
|
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EC2BlockDeviceMappingsBuilder interface {
|
type EC2BlockDeviceMappingsBuilder interface {
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepSecurityGroup struct {
|
type StepSecurityGroup struct {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
// &awscommon.StepSetGeneratedData{
|
// &awscommon.StepSetGeneratedData{
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepSourceAMIInfo extracts critical information from the source AMI
|
// StepSourceAMIInfo extracts critical information from the source AMI
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepStopEBSBackedInstance struct {
|
type StepStopEBSBackedInstance struct {
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TagMap map[string]string
|
type TagMap map[string]string
|
||||||
|
|
|
@ -16,14 +16,15 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/iam"
|
"github.com/aws/aws-sdk-go/service/iam"
|
||||||
"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/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The unique ID for this builder
|
// The unique ID for this builder
|
||||||
|
@ -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 {
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
"github.com/hashicorp/packer/builder/amazon/common/awserrors"
|
||||||
"github.com/hashicorp/packer/common/random"
|
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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/random"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepCreateAMI struct {
|
type stepCreateAMI struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ package ebssurrogate
|
||||||
import (
|
import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlockDevice struct {
|
type BlockDevice struct {
|
||||||
|
|
|
@ -14,14 +14,15 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/iam"
|
"github.com/aws/aws-sdk-go/service/iam"
|
||||||
"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/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
const BuilderId = "mitchellh.amazon.ebssurrogate"
|
const BuilderId = "mitchellh.amazon.ebssurrogate"
|
||||||
|
@ -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
|
||||||
|
|
|
@ -5,7 +5,7 @@ package ebssurrogate
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RootBlockDevice struct {
|
type RootBlockDevice struct {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common/random"
|
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepRegisterAMI creates the AMI.
|
// StepRegisterAMI creates the AMI.
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StepSnapshotVolumes creates snapshots of the created volumes.
|
// StepSnapshotVolumes creates snapshots of the created volumes.
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlockDevice struct {
|
type BlockDevice struct {
|
||||||
|
|
|
@ -13,14 +13,15 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/iam"
|
"github.com/aws/aws-sdk-go/service/iam"
|
||||||
"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/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
const BuilderId = "mitchellh.amazon.ebsvolume"
|
const BuilderId = "mitchellh.amazon.ebsvolume"
|
||||||
|
@ -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
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stepTagEBSVolumes struct {
|
type stepTagEBSVolumes struct {
|
||||||
|
|
|
@ -16,13 +16,14 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/iam"
|
"github.com/aws/aws-sdk-go/service/iam"
|
||||||
"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/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The unique ID for this builder
|
// The unique ID for this builder
|
||||||
|
@ -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
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type bundleCmdData struct {
|
type bundleCmdData struct {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/service/ec2"
|
"github.com/aws/aws-sdk-go/service/ec2"
|
||||||
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
awscommon "github.com/hashicorp/packer/builder/amazon/common"
|
||||||
"github.com/hashicorp/packer/common/random"
|
|
||||||
confighelper "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"
|
||||||
|
confighelper "github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepRegisterAMI struct {
|
type StepRegisterAMI struct {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type uploadCmdData struct {
|
type uploadCmdData struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
approvaltests "github.com/approvals/go-approval-tests"
|
approvaltests "github.com/approvals/go-approval-tests"
|
||||||
"github.com/hashicorp/packer/common/json"
|
"github.com/hashicorp/packer/packer-plugin-sdk/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
const AzureErrorSimple = `{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Compute/images/PackerUbuntuImage' under resource group 'packer-test00' was not found."}}`
|
const AzureErrorSimple = `{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Compute/images/PackerUbuntuImage' under resource group 'packer-test00' was not found."}}`
|
||||||
|
|
|
@ -18,10 +18,10 @@ 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/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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Builder struct {
|
type Builder struct {
|
||||||
|
@ -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.
|
||||||
|
|
|
@ -18,7 +18,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/random"
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute"
|
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute"
|
||||||
"github.com/Azure/go-autorest/autorest/to"
|
"github.com/Azure/go-autorest/autorest/to"
|
||||||
|
@ -28,12 +28,12 @@ import (
|
||||||
"github.com/hashicorp/packer/builder/azure/common/client"
|
"github.com/hashicorp/packer/builder/azure/common/client"
|
||||||
"github.com/hashicorp/packer/builder/azure/common/constants"
|
"github.com/hashicorp/packer/builder/azure/common/constants"
|
||||||
"github.com/hashicorp/packer/builder/azure/pkcs12"
|
"github.com/hashicorp/packer/builder/azure/pkcs12"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/hcl2template"
|
"github.com/hashicorp/packer/hcl2template"
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/builder/azure/common/constants"
|
"github.com/hashicorp/packer/builder/azure/common/constants"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepDeployTemplate struct {
|
type StepDeployTemplate struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/random"
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TempName struct {
|
type TempName struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/random"
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTempNameShouldCreatePrefixedRandomNames(t *testing.T) {
|
func TestTempNameShouldCreatePrefixedRandomNames(t *testing.T) {
|
||||||
|
|
|
@ -18,12 +18,13 @@ import (
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
azcommon "github.com/hashicorp/packer/builder/azure/common"
|
azcommon "github.com/hashicorp/packer/builder/azure/common"
|
||||||
"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/chroot"
|
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/chroot"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
|
||||||
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
|
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
|
||||||
"github.com/Azure/go-autorest/autorest/azure"
|
"github.com/Azure/go-autorest/autorest/azure"
|
||||||
|
@ -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
|
||||||
|
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"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"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ multistep.Step = &StepMountDevice{}
|
var _ multistep.Step = &StepMountDevice{}
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStepMountDevice_Run(t *testing.T) {
|
func TestStepMountDevice_Run(t *testing.T) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
approvaltests "github.com/approvals/go-approval-tests"
|
approvaltests "github.com/approvals/go-approval-tests"
|
||||||
"github.com/hashicorp/packer/common/json"
|
"github.com/hashicorp/packer/packer-plugin-sdk/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
const AzureErrorSimple = `{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Compute/images/PackerUbuntuImage' under resource group 'packer-test00' was not found."}}`
|
const AzureErrorSimple = `{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Compute/images/PackerUbuntuImage' under resource group 'packer-test00' was not found."}}`
|
||||||
|
|
|
@ -17,10 +17,10 @@ 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/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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Builder struct {
|
type Builder struct {
|
||||||
|
@ -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.
|
||||||
|
|
|
@ -24,11 +24,11 @@ import (
|
||||||
"github.com/hashicorp/packer/builder/azure/common/constants"
|
"github.com/hashicorp/packer/builder/azure/common/constants"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/builder/azure/pkcs12"
|
"github.com/hashicorp/packer/builder/azure/pkcs12"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
packertpl "github.com/hashicorp/packer/common/template"
|
packertpl "github.com/hashicorp/packer/packer-plugin-sdk/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
func isValidByteValue(b byte) bool {
|
func isValidByteValue(b byte) bool {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/random"
|
"github.com/hashicorp/packer/packer-plugin-sdk/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TempName struct {
|
type TempName struct {
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
"github.com/xanzy/go-cloudstack/cloudstack"
|
"github.com/xanzy/go-cloudstack/cloudstack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
|
@ -9,19 +9,20 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"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/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 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
|
||||||
// also be specified via environment variable CLOUDSTACK_API_URL, if set.
|
// also be specified via environment variable CLOUDSTACK_API_URL, if set.
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
"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/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
"github.com/xanzy/go-cloudstack/cloudstack"
|
"github.com/xanzy/go-cloudstack/cloudstack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
"github.com/xanzy/go-cloudstack/cloudstack"
|
"github.com/xanzy/go-cloudstack/cloudstack"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ 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/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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
|
@ -10,12 +10,12 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"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/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/digitalocean/godo"
|
"github.com/digitalocean/godo"
|
||||||
"github.com/hashicorp/packer/common/uuid"
|
|
||||||
"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/uuid"
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@ 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/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"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -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
|
||||||
|
|
|
@ -10,9 +10,9 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template"
|
||||||
"github.com/hashicorp/packer/provisioner/file"
|
"github.com/hashicorp/packer/provisioner/file"
|
||||||
"github.com/hashicorp/packer/provisioner/shell"
|
"github.com/hashicorp/packer/provisioner/shell"
|
||||||
"github.com/hashicorp/packer/template"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestUploadDownload verifies that basic upload / download functionality works
|
// TestUploadDownload verifies that basic upload / download functionality works
|
||||||
|
|
|
@ -7,11 +7,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/helper/communicator"
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
"github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
|
|
||||||
"github.com/hashicorp/go-version"
|
"github.com/hashicorp/go-version"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DockerDriver struct {
|
type DockerDriver struct {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package docker
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/shell-local/localexec"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/shell-local/localexec"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runAndStream(cmd *exec.Cmd, ui packer.Ui) error {
|
func runAndStream(cmd *exec.Cmd, ui packer.Ui) error {
|
||||||
|
|
|
@ -3,8 +3,8 @@ package docker
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepSetGeneratedData struct {
|
type StepSetGeneratedData struct {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/packerbuilderdata"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStepSetGeneratedData_Run(t *testing.T) {
|
func TestStepSetGeneratedData_Run(t *testing.T) {
|
||||||
|
|
|
@ -5,10 +5,10 @@ package file
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrTargetRequired = fmt.Errorf("target required")
|
var ErrTargetRequired = fmt.Errorf("target required")
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl/v2/hcldec"
|
"github.com/hashicorp/hcl/v2/hcldec"
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/commonsteps"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The unique ID for this builder.
|
// The unique ID for this builder.
|
||||||
|
@ -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.
|
||||||
|
|
|
@ -11,12 +11,12 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common"
|
|
||||||
"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/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
"github.com/hashicorp/packer/template/interpolate"
|
"github.com/hashicorp/packer/packer-plugin-sdk/common"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/uuid"
|
||||||
compute "google.golang.org/api/compute/v1"
|
compute "google.golang.org/api/compute/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ import (
|
||||||
oslogin "google.golang.org/api/oslogin/v1"
|
oslogin "google.golang.org/api/oslogin/v1"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/builder/googlecompute/version"
|
"github.com/hashicorp/packer/builder/googlecompute/version"
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"github.com/hashicorp/packer/helper/useragent"
|
"github.com/hashicorp/packer/helper/useragent"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
vaultapi "github.com/hashicorp/vault/api"
|
vaultapi "github.com/hashicorp/vault/api"
|
||||||
|
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,11 @@ import (
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/net"
|
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/net"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/retry"
|
||||||
"github.com/hashicorp/packer/packer/tmp"
|
"github.com/hashicorp/packer/packer/tmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/retry"
|
|
||||||
"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/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StepWaitStartupScript int
|
type StepWaitStartupScript int
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/helper/config"
|
|
||||||
"github.com/hashicorp/packer/helper/multistep"
|
"github.com/hashicorp/packer/helper/multistep"
|
||||||
|
"github.com/hashicorp/packer/packer-plugin-sdk/config"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue