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
f170c6f5
Commit
f170c6f5
authored
Jul 16, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/common: add StepProvision
parent
b3585746
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
builder/common/step_provision.go
builder/common/step_provision.go
+34
-0
builder/common/step_provision_test.go
builder/common/step_provision_test.go
+14
-0
No files found.
builder/common/step_provision.go
0 → 100644
View file @
f170c6f5
package
common
import
(
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
)
// StepProvision runs the provisioners.
//
// Uses:
// communicator packer.Communicator
// hook packer.Hook
// ui packer.Ui
//
// Produces:
// <nothing>
type
StepProvision
struct
{}
func
(
*
StepProvision
)
Run
(
state
map
[
string
]
interface
{})
multistep
.
StepAction
{
comm
:=
state
[
"communicator"
]
.
(
packer
.
Communicator
)
hook
:=
state
[
"hook"
]
.
(
packer
.
Hook
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
log
.
Println
(
"Running the provision hook"
)
if
err
:=
hook
.
Run
(
packer
.
HookProvision
,
ui
,
comm
,
nil
);
err
!=
nil
{
state
[
"error"
]
=
err
return
multistep
.
ActionHalt
}
return
multistep
.
ActionContinue
}
func
(
*
StepProvision
)
Cleanup
(
map
[
string
]
interface
{})
{}
builder/common/step_provision_test.go
0 → 100644
View file @
f170c6f5
package
common
import
(
"github.com/mitchellh/multistep"
"testing"
)
func
TestStepProvision_Impl
(
t
*
testing
.
T
)
{
var
raw
interface
{}
raw
=
new
(
StepProvision
)
if
_
,
ok
:=
raw
.
(
multistep
.
Step
);
!
ok
{
t
.
Fatalf
(
"provision should be a step"
)
}
}
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