Prepare for release (#37)

* Prepare for release

Added LICENSE, set version and configured GoReleaser/Docker

* Updated LICENSE
This commit is contained in:
Fedor Korotkov
2023-03-20 15:28:24 -04:00
committed by GitHub
parent fb3056d3ae
commit bdc781214c
9 changed files with 191 additions and 1 deletions
+16 -1
View File
@@ -5,18 +5,32 @@ import (
"errors"
"fmt"
"github.com/cirruslabs/orchard/internal/controller"
"github.com/cirruslabs/orchard/internal/netconstants"
"github.com/spf13/cobra"
"go.uber.org/zap"
"os"
"strconv"
)
var ErrRunFailed = errors.New("failed to run controller")
var address string
func newRunCommand() *cobra.Command {
return &cobra.Command{
cmd := &cobra.Command{
Use: "run",
Short: "Run the controller",
RunE: runController,
}
port := os.Getenv("PORT")
if port == "" {
port = strconv.FormatInt(netconstants.DefaultControllerPort, 10)
}
cmd.PersistentFlags().StringVarP(&address, "listen", "l", fmt.Sprintf(":%s", port), "address to listen on")
return cmd
}
func runController(cmd *cobra.Command, args []string) (err error) {
@@ -53,6 +67,7 @@ func runController(cmd *cobra.Command, args []string) (err error) {
}
controller, err := controller.New(
controller.WithListenAddr(address),
controller.WithDataDir(dataDir),
controller.WithLogger(logger),
controller.WithTLSConfig(&tls.Config{
+2
View File
@@ -11,6 +11,7 @@ import (
"github.com/cirruslabs/orchard/internal/command/portforward"
"github.com/cirruslabs/orchard/internal/command/stop"
"github.com/cirruslabs/orchard/internal/command/worker"
"github.com/cirruslabs/orchard/internal/version"
"github.com/spf13/cobra"
)
@@ -19,6 +20,7 @@ func NewRootCmd() *cobra.Command {
Use: "orchard",
SilenceUsage: true,
SilenceErrors: true,
Version: version.FullVersion,
}
addGroupedCommands(command, "Working With Resources:",