Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
ac029d9e
Commit
ac029d9e
authored
Jun 14, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: Use proper pausefn
parent
e0f2bcf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletion
+35
-1
builder/common/multistep_debug.go
builder/common/multistep_debug.go
+30
-0
builder/vmware/builder.go
builder/vmware/builder.go
+5
-1
No files found.
builder/common/multistep_debug.go
0 → 100644
View file @
ac029d9e
package
common
import
(
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
)
// MultistepDebugFn will return a proper multistep.DebugPauseFn to
// use for debugging if you're using multistep in your builder.
func
MultistepDebugFn
(
ui
packer
.
Ui
)
multistep
.
DebugPauseFn
{
return
func
(
loc
multistep
.
DebugLocation
,
name
string
,
state
map
[
string
]
interface
{})
{
var
locationString
string
switch
loc
{
case
multistep
.
DebugLocationAfterRun
:
locationString
=
"after run of"
case
multistep
.
DebugLocationBeforeCleanup
:
locationString
=
"before cleanup of"
default
:
locationString
=
"at"
}
message
:=
fmt
.
Sprintf
(
"Pausing %s step '%s'. Press any key to continue.
\n
"
,
locationString
,
name
)
ui
.
Say
(
message
)
ui
.
Ask
(
""
)
}
}
builder/vmware/builder.go
View file @
ac029d9e
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"fmt"
"fmt"
"github.com/mitchellh/mapstructure"
"github.com/mitchellh/mapstructure"
"github.com/mitchellh/multistep"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/builder/common"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
"log"
"log"
"math/rand"
"math/rand"
...
@@ -217,7 +218,10 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
...
@@ -217,7 +218,10 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
// Run!
// Run!
if
b
.
config
.
PackerDebug
{
if
b
.
config
.
PackerDebug
{
b
.
runner
=
&
multistep
.
DebugRunner
{
Steps
:
steps
}
b
.
runner
=
&
multistep
.
DebugRunner
{
Steps
:
steps
,
PauseFn
:
common
.
MultistepDebugFn
(
ui
),
}
}
else
{
}
else
{
b
.
runner
=
&
multistep
.
BasicRunner
{
Steps
:
steps
}
b
.
runner
=
&
multistep
.
BasicRunner
{
Steps
:
steps
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment