versioning
This commit is contained in:
parent
666daabe95
commit
90332cd134
4
Makefile
4
Makefile
@ -5,12 +5,14 @@ ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|||||||
BUILD_DIR=$(ROOT_DIR)/build
|
BUILD_DIR=$(ROOT_DIR)/build
|
||||||
BIN=$(BUILD_DIR)/sshpoke
|
BIN=$(BUILD_DIR)/sshpoke
|
||||||
GO_VERSION=$(shell go version | sed -e 's/go version //')
|
GO_VERSION=$(shell go version | sed -e 's/go version //')
|
||||||
|
VERSION=$(shell git describe --tags 2>/dev/null || git log --format="v0.0.0-%h" -n 1 || echo "v0.0.0-unknown")
|
||||||
|
LDFLAGS="-X 'github.com/Neur0toxine/sshpoke/cmd.Version=${VERSION}'"
|
||||||
|
|
||||||
.PHONY: run clean_backend
|
.PHONY: run clean_backend
|
||||||
|
|
||||||
build: generate deps fmt
|
build: generate deps fmt
|
||||||
@echo " ► Building with ${GO_VERSION}"
|
@echo " ► Building with ${GO_VERSION}"
|
||||||
@CGO_ENABLED=0 go build -tags=release -o $(BIN) .
|
@CGO_ENABLED=0 go build -tags=release -ldflags ${LDFLAGS} -o $(BIN) .
|
||||||
@echo $(BIN)
|
@echo $(BIN)
|
||||||
|
|
||||||
test: deps fmt
|
test: deps fmt
|
||||||
|
@ -17,10 +17,14 @@ import (
|
|||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cfgFile string
|
var (
|
||||||
|
cfgFile string
|
||||||
|
Version string
|
||||||
|
)
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "sshpoke",
|
Use: "sshpoke",
|
||||||
|
Version: Version,
|
||||||
Short: "Expose your Docker services to the Internet via SSH.",
|
Short: "Expose your Docker services to the Internet via SSH.",
|
||||||
Long: `sshpoke is a CLI application that listens to the docker socket and automatically exposes relevant services to the Internet.`,
|
Long: `sshpoke is a CLI application that listens to the docker socket and automatically exposes relevant services to the Internet.`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user