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
1e7c814e
Commit
1e7c814e
authored
Aug 08, 2016
by
joe2far
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Serve charts from specified local repository path
parent
584245ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
serve.go
cmd/helm/serve.go
+19
-7
No files found.
cmd/helm/serve.go
View file @
1e7c814e
...
@@ -17,17 +17,19 @@ limitations under the License.
...
@@ -17,17 +17,19 @@ limitations under the License.
package
main
package
main
import
(
import
(
"os"
"path/filepath"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"k8s.io/helm/pkg/repo"
"k8s.io/helm/pkg/repo"
)
)
var
serveDesc
=
`This command starts a local chart repository server that serves the charts saved in your $HELM_HOME/local/ directory.`
var
serveDesc
=
`This command starts a local chart repository server that serves charts from a local directory.`
var
repoPath
string
//TODO: add repoPath flag to be passed in in case you want
// to serve charts from a different local dir
func
init
()
{
func
init
()
{
serveCmd
.
Flags
()
.
StringVar
(
&
repoPath
,
"repo-path"
,
localRepoDirectory
(),
"The local directory path from which to serve charts."
)
RootCommand
.
AddCommand
(
serveCmd
)
RootCommand
.
AddCommand
(
serveCmd
)
}
}
...
@@ -35,9 +37,19 @@ var serveCmd = &cobra.Command{
...
@@ -35,9 +37,19 @@ var serveCmd = &cobra.Command{
Use
:
"serve"
,
Use
:
"serve"
,
Short
:
"start a local http web server"
,
Short
:
"start a local http web server"
,
Long
:
serveDesc
,
Long
:
serveDesc
,
Run
:
serve
,
Run
E
:
serve
,
}
}
func
serve
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
func
serve
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
repo
.
StartLocalRepo
(
localRepoDirectory
())
repoPath
,
err
:=
filepath
.
Abs
(
repoPath
)
if
err
!=
nil
{
return
err
}
if
_
,
err
:=
os
.
Stat
(
repoPath
);
os
.
IsNotExist
(
err
)
{
return
err
}
repo
.
StartLocalRepo
(
repoPath
)
return
nil
}
}
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