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
c12e9ff9
Commit
c12e9ff9
authored
Jun 17, 2013
by
Jack Pearkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/digitalocean: implement artifacts with the snapshot name
parent
25d58740
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
builder/digitalocean/artifact.go
builder/digitalocean/artifact.go
+27
-0
builder/digitalocean/artifact_test.go
builder/digitalocean/artifact_test.go
+23
-0
builder/digitalocean/builder.go
builder/digitalocean/builder.go
+1
-1
No files found.
builder/digitalocean/artifact.go
0 → 100644
View file @
c12e9ff9
package
digitalocean
import
(
"fmt"
)
type
Artifact
struct
{
// The name of the snapshot
snapshotName
string
}
func
(
*
Artifact
)
BuilderId
()
string
{
return
BuilderId
}
func
(
*
Artifact
)
Files
()
[]
string
{
// No files with DigitalOcean
return
nil
}
func
(
a
*
Artifact
)
Id
()
string
{
return
a
.
snapshotName
}
func
(
a
*
Artifact
)
String
()
string
{
return
fmt
.
Sprintf
(
"A snapshot was created: %v"
,
a
.
snapshotName
)
}
builder/digitalocean/artifact_test.go
0 → 100644
View file @
c12e9ff9
package
digitalocean
import
(
"github.com/mitchellh/packer/packer"
"testing"
)
func
TestArtifact_Impl
(
t
*
testing
.
T
)
{
var
raw
interface
{}
raw
=
&
Artifact
{}
if
_
,
ok
:=
raw
.
(
packer
.
Artifact
);
!
ok
{
t
.
Fatalf
(
"Artifact should be artifact"
)
}
}
func
TestArtifactString
(
t
*
testing
.
T
)
{
a
:=
&
Artifact
{
"packer-foobar"
}
expected
:=
"A snapshot was created: packer-foobar"
if
a
.
String
()
!=
expected
{
t
.
Fatalf
(
"artifact string should match: %v"
,
expected
)
}
}
builder/digitalocean/builder.go
View file @
c12e9ff9
...
...
@@ -148,7 +148,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
b
.
runner
.
Run
(
state
)
return
nil
,
nil
return
&
Artifact
{
b
.
config
.
SnapshotName
}
,
nil
}
func
(
b
*
Builder
)
Cancel
()
{
...
...
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