Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
a5a1ef95
Commit
a5a1ef95
authored
Apr 19, 2016
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(package): save package to $HELM_HOME/local
parent
fbd6ffa4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
package.go
cmd/helm/package.go
+15
-1
No files found.
cmd/helm/package.go
View file @
a5a1ef95
...
...
@@ -20,7 +20,10 @@ Chart.yaml file, and (if found) build the current directory into a chart.
Versioned chart archives are used by Helm package repositories.
`
var
save
bool
func
init
()
{
packageCmd
.
Flags
()
.
BoolVar
(
&
save
,
"save"
,
true
,
"save packaged chart to local chart repository"
)
RootCommand
.
AddCommand
(
packageCmd
)
}
...
...
@@ -50,6 +53,17 @@ func runPackage(cmd *cobra.Command, args []string) error {
return
err
}
// Save to $HELM_HOME/local directory.
if
save
{
dir
:=
LocalDirectory
(
os
.
ExpandEnv
(
helmHome
))
name
,
err
:=
chart
.
Save
(
ch
,
dir
)
if
err
==
nil
{
cmd
.
Printf
(
"Saved %s to $HELM_HOME/local/
\n
"
,
name
)
}
else
{
return
err
}
}
// Save to the current working directory.
cwd
,
err
:=
os
.
Getwd
()
if
err
!=
nil
{
...
...
@@ -57,7 +71,7 @@ func runPackage(cmd *cobra.Command, args []string) error {
}
name
,
err
:=
chart
.
Save
(
ch
,
cwd
)
if
err
==
nil
{
cmd
.
Printf
(
"Saved %s"
,
name
)
cmd
.
Printf
(
"Saved %s
to current directory
\n
"
,
name
)
}
return
err
}
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