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
c1fbc473
Commit
c1fbc473
authored
Nov 06, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/push: propagate token properly
parent
6bd8c6ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
command/push.go
command/push.go
+7
-3
packer/template.go
packer/template.go
+1
-0
No files found.
command/push.go
View file @
c1fbc473
...
...
@@ -57,6 +57,11 @@ func (c *PushCommand) Run(args []string) int {
return
1
}
// Determine our token
if
token
==
""
{
token
=
tpl
.
Push
.
Token
}
// Build our client
defer
func
()
{
c
.
client
=
nil
}()
c
.
client
=
harmony
.
DefaultClient
()
...
...
@@ -68,6 +73,7 @@ func (c *PushCommand) Run(args []string) int {
return
1
}
}
c
.
client
.
Token
=
token
// Build the archiving options
var
opts
archive
.
ArchiveOpts
...
...
@@ -92,7 +98,6 @@ func (c *PushCommand) Run(args []string) int {
// Build the upload options
var
uploadOpts
uploadOpts
uploadOpts
.
Slug
=
tpl
.
Push
.
Name
uploadOpts
.
Token
=
token
uploadOpts
.
Builds
=
make
(
map
[
string
]
string
)
for
_
,
b
:=
range
tpl
.
Builders
{
uploadOpts
.
Builds
[
b
.
Name
]
=
b
.
Type
...
...
@@ -184,7 +189,7 @@ func (c *PushCommand) create(name string, create bool) error {
if
!
create
{
return
fmt
.
Errorf
(
"Push target doesn't exist: %s. Either create this online via
\n
"
+
"the website or pass the -create flag."
)
"the website or pass the -create flag."
,
name
)
}
// Create it
...
...
@@ -244,6 +249,5 @@ func (c *PushCommand) upload(
type
uploadOpts
struct
{
URL
string
Slug
string
Token
string
Builds
map
[
string
]
string
}
packer/template.go
View file @
c1fbc473
...
...
@@ -49,6 +49,7 @@ type PushConfig struct {
BaseDir
string
Include
[]
string
Exclude
[]
string
Token
string
VCS
bool
}
...
...
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