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
983b0b89
Commit
983b0b89
authored
Feb 03, 2015
by
Seth Vargo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow specifying a -message when pushing
parent
7911d988
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
command/push.go
command/push.go
+16
-7
website/source/docs/command-line/push.html.markdown
website/source/docs/command-line/push.html.markdown
+5
-1
No files found.
command/push.go
View file @
983b0b89
...
...
@@ -38,6 +38,7 @@ func (c *PushCommand) Run(args []string) int {
f
:=
flag
.
NewFlagSet
(
"push"
,
flag
.
ContinueOnError
)
f
.
Usage
=
func
()
{
c
.
Ui
.
Error
(
c
.
Help
())
}
f
.
StringVar
(
&
token
,
"token"
,
""
,
"token"
)
f
.
StringVar
(
&
message
,
"m"
,
""
,
"message"
)
f
.
StringVar
(
&
message
,
"message"
,
""
,
"message"
)
if
err
:=
f
.
Parse
(
args
);
err
!=
nil
{
return
1
...
...
@@ -149,6 +150,13 @@ func (c *PushCommand) Run(args []string) int {
uploadOpts
.
Builds
[
b
.
Name
]
=
info
}
// Add the upload metadata
metadata
:=
make
(
map
[
string
]
interface
{})
if
message
!=
""
{
metadata
[
"message"
]
=
message
}
uploadOpts
.
Metadata
=
metadata
// Warn about builds not having post-processors.
var
badBuilds
[]
string
for
name
,
b
:=
range
uploadOpts
.
Builds
{
...
...
@@ -224,10 +232,10 @@ Usage: packer push [options] TEMPLATE
Options:
-message=<detail> A message to identify the purpose or changes in this
Packer template much like a VCS commit message
-m
, -m
essage=<detail> A message to identify the purpose or changes in this
Packer template much like a VCS commit message
-token=<token> The access token to use to when uploading
-token=<token>
The access token to use to when uploading
`
return
strings
.
TrimSpace
(
helpText
)
...
...
@@ -279,7 +287,7 @@ func (c *PushCommand) upload(
// Start the upload
doneCh
,
errCh
:=
make
(
chan
struct
{}),
make
(
chan
error
)
go
func
()
{
err
:=
c
.
client
.
UploadBuildConfigVersion
(
&
version
,
r
,
r
.
Size
)
err
:=
c
.
client
.
UploadBuildConfigVersion
(
&
version
,
opts
.
Metadata
,
r
,
r
.
Size
)
if
err
!=
nil
{
errCh
<-
err
return
...
...
@@ -292,9 +300,10 @@ func (c *PushCommand) upload(
}
type
uploadOpts
struct
{
URL
string
Slug
string
Builds
map
[
string
]
*
uploadBuildInfo
URL
string
Slug
string
Builds
map
[
string
]
*
uploadBuildInfo
Metadata
map
[
string
]
interface
{}
}
type
uploadBuildInfo
struct
{
...
...
website/source/docs/command-line/push.html.markdown
View file @
983b0b89
...
...
@@ -25,6 +25,10 @@ must be completed within the template.
## Options
*
`-message`
- A message to identify the purpose or changes in this Packer
template much like a VCS commit message. This message will be passed to the
Packer build service. This option is also available as a short option
`-m`
.
*
`-token`
- An access token for authenticating the push to the Packer build
service such as Atlas. This can also be specified within the push
configuration in the template.
...
...
@@ -34,7 +38,7 @@ must be completed within the template.
Push a Packer template:
```
shell
$
packer push template.json
$
packer push
-m
"Updating the apache version"
template.json
```
Push a Packer template with a custom token:
...
...
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