update info of infra/README.md
[ealt-edge.git] / ocd / cli / ealt / cmd / init / edge.go
1 /*
2 Copyright 2020 Huawei Technologies Co., Ltd.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16 package init
17
18 import (
19         "fmt"
20
21         setup "ealt/cmd/setup"
22
23         "github.com/spf13/cobra"
24 )
25
26 func NewEdgeCommand() *cobra.Command {
27         var cmd = &cobra.Command{
28                 Use:   "edge",
29                 Short: "Install Edge Node",
30                 Long:  `Command to Install Edge Node only For Example : ealt init edge`,
31                 RunE: func(cmd *cobra.Command, args []string) error {
32                         fmt.Println("Installation of Edge components")
33                         var err error
34                         err = setup.EaltInstall("edge")
35                         if err != nil {
36                                 return err
37                         }
38                         return nil
39                 },
40         }
41         cmd.Flags().StringP("mode", "m", "dev", "Deployment Mode")
42         return cmd
43 }