spud/cli/start_service.go

27 lines
538 B
Go

// Start services
//
// Commands related to starting services.
package cli
import (
"github.com/spf13/cobra"
"log"
service "spud/service"
service_definition "spud/service_definition"
)
var start = &cobra.Command{
Use: "start",
Short: "Creates or updates a service based on the provided definition.",
Run: func(cmd *cobra.Command, args []string) {
pathProvided := args[0]
def, err := service_definition.GetServiceDefinitionFromFile(pathProvided)
if err != nil {
log.Fatal(err)
}
service.CreateService(def)
},
}