Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/supervisor/cmd/run.go
2498 views
1
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
"github.com/spf13/cobra"
9
10
common_grpc "github.com/gitpod-io/gitpod/common-go/grpc"
11
"github.com/gitpod-io/gitpod/supervisor/pkg/supervisor"
12
)
13
14
var runOpts struct {
15
RunGP bool
16
}
17
18
var runCmd = &cobra.Command{
19
Use: "run",
20
Short: "starts the supervisor",
21
22
Run: func(cmd *cobra.Command, args []string) {
23
logFile := initLog(!runOpts.RunGP)
24
defer logFile.Close()
25
26
common_grpc.SetupLogging()
27
supervisor.Version = Version
28
supervisor.Run(supervisor.WithRunGP(runOpts.RunGP))
29
},
30
}
31
32
func init() {
33
rootCmd.AddCommand(runCmd)
34
runCmd.Flags().BoolVar(&runOpts.RunGP, "rungp", false, "run supervisor in a run-gp context")
35
}
36
37