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
33f8d295
Commit
33f8d295
authored
May 27, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazonebs, command/build: use new UI interface
parent
2788d29b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
builder/amazonebs/step_connect_ssh.go
builder/amazonebs/step_connect_ssh.go
+2
-2
builder/amazonebs/step_create_ami.go
builder/amazonebs/step_create_ami.go
+2
-1
builder/amazonebs/step_keypair.go
builder/amazonebs/step_keypair.go
+2
-2
command/build/command.go
command/build/command.go
+4
-4
No files found.
builder/amazonebs/step_connect_ssh.go
View file @
33f8d295
...
...
@@ -26,7 +26,7 @@ func (s *stepConnectSSH) Run(state map[string]interface{}) StepAction {
keyring
:=
&
ssh
.
SimpleKeychain
{}
err
:=
keyring
.
AddPEMKey
(
privateKey
)
if
err
!=
nil
{
ui
.
Say
(
"Error setting up SSH config: %s"
,
err
.
Error
(
))
ui
.
Say
(
fmt
.
Sprintf
(
"Error setting up SSH config: %s"
,
err
))
return
StepHalt
}
...
...
@@ -58,7 +58,7 @@ func (s *stepConnectSSH) Run(state map[string]interface{}) StepAction {
}
if
err
!=
nil
{
ui
.
Error
(
"Error connecting to SSH: %s"
,
err
.
Error
(
))
ui
.
Error
(
fmt
.
Sprintf
(
"Error connecting to SSH: %s"
,
err
))
return
StepHalt
}
...
...
builder/amazonebs/step_create_ami.go
View file @
33f8d295
package
amazonebs
import
(
"fmt"
"github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/packer/packer"
)
...
...
@@ -27,7 +28,7 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) StepAction {
}
// Set the AMI ID in the state
ui
.
Say
(
"AMI: %s"
,
createResp
.
ImageId
)
ui
.
Say
(
fmt
.
Sprintf
(
"AMI: %s"
,
createResp
.
ImageId
)
)
amis
:=
make
(
map
[
string
]
string
)
amis
[
config
.
Region
]
=
createResp
.
ImageId
state
[
"amis"
]
=
amis
...
...
builder/amazonebs/step_keypair.go
View file @
33f8d295
...
...
@@ -48,7 +48,7 @@ func (s *stepKeyPair) Cleanup(state map[string]interface{}) {
ui
.
Say
(
"Deleting temporary keypair..."
)
_
,
err
:=
ec2conn
.
DeleteKeyPair
(
s
.
keyName
)
if
err
!=
nil
{
ui
.
Error
(
"Error cleaning up keypair. Please delete the key manually: %s"
,
s
.
keyName
)
ui
.
Error
(
fmt
.
Sprintf
(
"Error cleaning up keypair. Please delete the key manually: %s"
,
s
.
keyName
)
)
}
}
command/build/command.go
View file @
33f8d295
...
...
@@ -20,7 +20,7 @@ func (Command) Run(env packer.Environment, args []string) int {
log
.
Printf
(
"Reading template: %s"
,
args
[
0
])
tplData
,
err
:=
ioutil
.
ReadFile
(
args
[
0
])
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
"Failed to read template file: %s"
,
err
.
Error
(
))
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"Failed to read template file: %s"
,
err
))
return
1
}
...
...
@@ -28,7 +28,7 @@ func (Command) Run(env packer.Environment, args []string) int {
log
.
Println
(
"Parsing template..."
)
tpl
,
err
:=
packer
.
ParseTemplate
(
tplData
)
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
"Failed to parse template: %s"
,
err
.
Error
(
))
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"Failed to parse template: %s"
,
err
))
return
1
}
...
...
@@ -46,7 +46,7 @@ func (Command) Run(env packer.Environment, args []string) int {
log
.
Printf
(
"Creating build: %s"
,
buildName
)
build
,
err
:=
tpl
.
Build
(
buildName
,
components
)
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
"Failed to create build '%s':
\n\n
%s"
,
buildName
,
err
.
Error
(
))
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"Failed to create build '%s':
\n\n
%s"
,
buildName
,
err
))
return
1
}
...
...
@@ -93,7 +93,7 @@ func (Command) Run(env packer.Environment, args []string) int {
// Output all the artifacts
env
.
Ui
()
.
Say
(
"
\n
==> The build completed! The artifacts created were:"
)
for
name
,
artifact
:=
range
artifacts
{
env
.
Ui
()
.
Say
(
"--> %s:"
,
name
)
env
.
Ui
()
.
Say
(
fmt
.
Sprintf
(
"--> %s:"
,
name
)
)
env
.
Ui
()
.
Say
(
artifact
.
String
())
}
...
...
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