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
21bb0674
Commit
21bb0674
authored
Nov 12, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/docker: ctrl-C works during provisioning
parent
d88cb09d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
builder/docker/step_provision.go
builder/docker/step_provision.go
+3
-10
common/step_provision.go
common/step_provision.go
+9
-3
No files found.
builder/docker/step_provision.go
View file @
21bb0674
...
...
@@ -2,16 +2,14 @@ package docker
import
(
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/
packer
"
"github.com/mitchellh/packer/
common
"
)
type
StepProvision
struct
{}
func
(
s
*
StepProvision
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
containerId
:=
state
.
Get
(
"container_id"
)
.
(
string
)
hook
:=
state
.
Get
(
"hook"
)
.
(
packer
.
Hook
)
tempDir
:=
state
.
Get
(
"temp_dir"
)
.
(
string
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
// Create the communicator that talks to Docker via various
// os/exec tricks.
...
...
@@ -21,13 +19,8 @@ func (s *StepProvision) Run(state multistep.StateBag) multistep.StepAction {
ContainerDir
:
"/packer-files"
,
}
// Run the provisioning hook
if
err
:=
hook
.
Run
(
packer
.
HookProvision
,
ui
,
comm
,
nil
);
err
!=
nil
{
state
.
Put
(
"error"
,
err
)
return
multistep
.
ActionHalt
}
return
multistep
.
ActionContinue
prov
:=
common
.
StepProvision
{
Comm
:
comm
}
return
prov
.
Run
(
state
)
}
func
(
s
*
StepProvision
)
Cleanup
(
state
multistep
.
StateBag
)
{}
common/step_provision.go
View file @
21bb0674
...
...
@@ -16,10 +16,16 @@ import (
//
// Produces:
// <nothing>
type
StepProvision
struct
{}
type
StepProvision
struct
{
Comm
packer
.
Communicator
}
func
(
s
*
StepProvision
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
s
.
Comm
if
comm
==
nil
{
comm
=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
}
func
(
*
StepProvision
)
Run
(
state
multistep
.
StateBag
)
multistep
.
StepAction
{
comm
:=
state
.
Get
(
"communicator"
)
.
(
packer
.
Communicator
)
hook
:=
state
.
Get
(
"hook"
)
.
(
packer
.
Hook
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
...
...
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