Skip to content

Commit

Permalink
fix git/version
Browse files Browse the repository at this point in the history
  • Loading branch information
evlekht committed Oct 9, 2024
1 parent cf6c0d7 commit d0c622f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions cmd/camino_messenger_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cmd
import (
"context"
"fmt"
"log"
"os/signal"
"syscall"

Expand All @@ -29,10 +28,6 @@ var rootCmd = &cobra.Command{
}

func rootFunc(cmd *cobra.Command, _ []string) error {
// TODO @evlekht normal log printing
log.Printf("Version %s", Version)
log.Printf("GitCommit %s", GitCommit)

configReader := config.NewConfigReader(cmd.Flags())

var err error
Expand All @@ -49,6 +44,8 @@ func rootFunc(cmd *cobra.Command, _ []string) error {
logger := zapLogger.Sugar()
defer func() { _ = logger.Sync() }()

logger.Infof("App version: %s (git: %s)", Version, GitCommit)

ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()

Expand Down
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ CAMINOBOT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
# Load the constants
source "$CAMINOBOT_PATH"/scripts/constants.sh

LDFLAGS="-X main.GitCommit=$git_commit"
LDFLAGS="$LDFLAGS -X main.Version=$git_tag"
LDFLAGS="-X github.com/chain4travel/camino-messenger-bot/cmd.GitCommit=$git_commit"
LDFLAGS="$LDFLAGS -X github.com/chain4travel/camino-messenger-bot/cmd.Version=$git_tag"

# Build the Go application
echo "Building camino-messenger-bot..."
Expand Down

0 comments on commit d0c622f

Please sign in to comment.