Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.18-alpine

WORKDIR /app

COPY go.mod ./

RUN go mod download

COPY . .

RUN go build -o cli cmd/cli/main.go

CMD [ "./cli" ]
4 changes: 2 additions & 2 deletions cmd/cli/announce.go → cli/announce.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"context"
Expand All @@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
)

func newAnnounceCmd() *cobra.Command {
func NewAnnounceCmd() *cobra.Command {
var leaderClient *ServerClient

// Where the new settings will be put
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/client.go → cli/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/color-utils.go → cli/color-utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"os"
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/describe.go → cli/describe.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"context"
Expand All @@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
)

func newDescribeCmd() *cobra.Command {
func NewDescribeCmd() *cobra.Command {
var leaderClient *ServerClient

cmd := &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/flags.go → cli/flags.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"github.com/polygon-io/go-app-ticker-wall/models"
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/gui.go → cli/gui.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"os"
Expand All @@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
)

func newGUICmd() *cobra.Command {
func NewGUICmd() *cobra.Command {
cfg := &gui.Config{}

cmd := &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/server.go → cli/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"os"
Expand All @@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra"
)

func newServerCmd() *cobra.Command {
func NewServerCmd() *cobra.Command {
cfg := &server.ServiceConfig{
LeaderConfig: leader.Config{
Presentation: &models.PresentationSettings{},
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/update.go → cli/update.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cli

import (
"context"
Expand All @@ -8,7 +8,7 @@ import (
"github.com/spf13/cobra"
)

func newUpdateCmd() *cobra.Command {
func NewUpdateCmd() *cobra.Command {
var leaderClient *ServerClient

// Where the new settings will be put
Expand Down
11 changes: 6 additions & 5 deletions cmd/cli/cli.go → cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"strings"

"github.com/polygon-io/go-app-ticker-wall/cli"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -62,11 +63,11 @@ Find out more at: https://github.com/polygon-io/go-app-ticker-wall`,
rootCmd.PersistentFlags().BoolP("debug", "d", false, "Debug enables more verbose logging.")

// Add additional commands.
rootCmd.AddCommand(newGUICmd())
rootCmd.AddCommand(newServerCmd())
rootCmd.AddCommand(newUpdateCmd())
rootCmd.AddCommand(newAnnounceCmd())
rootCmd.AddCommand(newDescribeCmd())
rootCmd.AddCommand(cli.NewGUICmd())
rootCmd.AddCommand(cli.NewServerCmd())
rootCmd.AddCommand(cli.NewUpdateCmd())
rootCmd.AddCommand(cli.NewAnnounceCmd())
rootCmd.AddCommand(cli.NewDescribeCmd())

return rootCmd
}
Expand Down