Skip to content

Commit

Permalink
Added version support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkobaly committed Aug 12, 2020
1 parent 43e145d commit 3ba42cd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.7
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GOOS=linux GOARCH=amd64 go build
go build
env GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(cat .version)" -o ./bin/esdeploy
env GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=$(cat .version)" -o ./bin/esdeploy.exe
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
"github.com/fatih/color"
)

var (
version string
)

var (
app = kingpin.New("esdeploy", "A command-line deployment tool to version ElasticSearch.")
appUser = app.Flag("username", "Username to authenticate with").Short('u').String()
Expand All @@ -34,12 +38,18 @@ var (
seedCmd = app.Command("seed", "Seed elastic search with data stored in json files")
seedURL = seedCmd.Arg("url", "Elastic Search URL to run against").Required().String()
seedPath = seedCmd.Flag("folder", "Folder containing json data files").Short('f').Default(".").String()

versionCmd = app.Command("version", "Display version of esdeploy")
)

func main() {
var cred elastic.Creds

switch kingpin.MustParse(app.Parse(os.Args[1:])) {
case versionCmd.FullCommand():
color.Cyan("version %v", version)
os.Exit(0)

//Validation
case validateCmd.FullCommand():
if *validatePath == "" {
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Commands:
seed [<flags>] <url>
Seed elastic search with data stored in json files
version
Display version of esdeploy
```

## JS File Standard
Expand Down

0 comments on commit 3ba42cd

Please sign in to comment.