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
84ac5cd3
Commit
84ac5cd3
authored
Apr 15, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21 from technosophos/feat/helm-package
feat(helm): add 'helm package' command
parents
3830e996
68e3cc1c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
package.go
cmd/helm/package.go
+59
-0
No files found.
cmd/helm/package.go
0 → 100644
View file @
84ac5cd3
package
main
import
(
"os"
"path/filepath"
"github.com/deis/tiller/pkg/chart"
"github.com/spf13/cobra"
)
const
packageDesc
=
`
This command packages a chart into a versioned chart archive file. If a path
is given, this will look at that path for a chart (which must contain a
Chart.yaml file) and then package that directory.
If no path is given, this will look in the present working directory for a
Chart.yaml file, and (if found) build the current directory into a chart.
Versioned chart archives are used by Helm package repositories.
`
func
init
()
{
RootCommand
.
AddCommand
(
packageCmd
)
}
var
packageCmd
=
&
cobra
.
Command
{
Use
:
"package"
,
Short
:
"Package a chart directory into a chart archive."
,
Long
:
packageDesc
,
RunE
:
runPackage
,
}
func
runPackage
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
path
:=
"."
if
len
(
args
)
>
0
{
path
=
args
[
0
]
}
path
,
err
:=
filepath
.
Abs
(
path
)
if
err
!=
nil
{
return
err
}
ch
,
err
:=
chart
.
LoadDir
(
path
)
if
err
!=
nil
{
return
err
}
// Save to the current working directory.
cwd
,
err
:=
os
.
Getwd
()
if
err
!=
nil
{
return
err
}
name
,
err
:=
chart
.
Save
(
ch
,
cwd
)
if
err
==
nil
{
cmd
.
Printf
(
"Saved %s"
,
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