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
82cbf13f
Commit
82cbf13f
authored
Nov 02, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer/plugin: new Builder interface
parent
b2b125d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
15 deletions
+2
-15
packer/plugin/builder.go
packer/plugin/builder.go
+1
-1
packer/plugin/builder_test.go
packer/plugin/builder_test.go
+0
-13
packer/plugin/plugin_test.go
packer/plugin/plugin_test.go
+1
-1
No files found.
packer/plugin/builder.go
View file @
82cbf13f
...
@@ -10,7 +10,7 @@ type cmdBuilder struct {
...
@@ -10,7 +10,7 @@ type cmdBuilder struct {
client
*
Client
client
*
Client
}
}
func
(
b
*
cmdBuilder
)
Prepare
(
config
...
interface
{})
error
{
func
(
b
*
cmdBuilder
)
Prepare
(
config
...
interface
{})
([]
string
,
error
)
{
defer
func
()
{
defer
func
()
{
r
:=
recover
()
r
:=
recover
()
b
.
checkExit
(
r
,
nil
)
b
.
checkExit
(
r
,
nil
)
...
...
packer/plugin/builder_test.go
View file @
82cbf13f
package
plugin
package
plugin
import
(
import
(
"github.com/mitchellh/packer/packer"
"os/exec"
"os/exec"
"testing"
"testing"
)
)
type
helperBuilder
byte
func
(
helperBuilder
)
Prepare
(
...
interface
{})
error
{
return
nil
}
func
(
helperBuilder
)
Run
(
packer
.
Ui
,
packer
.
Hook
,
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
return
nil
,
nil
}
func
(
helperBuilder
)
Cancel
()
{}
func
TestBuilder_NoExist
(
t
*
testing
.
T
)
{
func
TestBuilder_NoExist
(
t
*
testing
.
T
)
{
c
:=
NewClient
(
&
ClientConfig
{
Cmd
:
exec
.
Command
(
"i-should-not-exist"
)})
c
:=
NewClient
(
&
ClientConfig
{
Cmd
:
exec
.
Command
(
"i-should-not-exist"
)})
defer
c
.
Kill
()
defer
c
.
Kill
()
...
...
packer/plugin/plugin_test.go
View file @
82cbf13f
...
@@ -54,7 +54,7 @@ func TestHelperProcess(*testing.T) {
...
@@ -54,7 +54,7 @@ func TestHelperProcess(*testing.T) {
fmt
.
Printf
(
"%s1|:1234
\n
"
,
APIVersion
)
fmt
.
Printf
(
"%s1|:1234
\n
"
,
APIVersion
)
<-
make
(
chan
int
)
<-
make
(
chan
int
)
case
"builder"
:
case
"builder"
:
ServeBuilder
(
new
(
helper
Builder
))
ServeBuilder
(
new
(
packer
.
Mock
Builder
))
case
"command"
:
case
"command"
:
ServeCommand
(
new
(
helperCommand
))
ServeCommand
(
new
(
helperCommand
))
case
"hook"
:
case
"hook"
:
...
...
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