File tree 5 files changed +61
-3
lines changed
5 files changed +61
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ builds:
10
10
- linux
11
11
- windows
12
12
- darwin
13
+ ldflags : -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`.
13
14
14
15
archives :
15
16
- format : tar.gz
42
43
homepage : https://github.com/meap/runecs
43
44
tap :
44
45
owner : meap
45
- name : homebrew
46
+ name : homebrew-runecs
46
47
commit_author :
47
48
name : meap
48
49
49
-
50
+
Original file line number Diff line number Diff line change @@ -7,6 +7,18 @@ RunECS is a tool for executing one-off processes in an ECS cluster.
7
7
* Only FARGATE launch type is supported.
8
8
* Sidecar containers are not supported
9
9
10
+ # Install
11
+
12
+ ## Manual
13
+
14
+ Download the binary file for your platform, [ see releases] ( https://github.com/meap/runecs/releases ) .
15
+
16
+ ## Homebrew
17
+
18
+ ``` shell
19
+ brew tap meap/runecs
20
+ brew install runecs
21
+ ```
10
22
11
23
# How to Use
12
24
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ import (
29
29
var rootCmd = & cobra.Command {}
30
30
31
31
func init () {
32
- rootCmd .PersistentFlags ().String ("service" , "" , "service name (cluster/service)" )
33
32
rootCmd .CompletionOptions .DisableDefaultCmd = true
33
+ rootCmd .PersistentFlags ().String ("service" , "" , "service name (cluster/service)" )
34
34
viper .BindPFlag ("service" , rootCmd .PersistentFlags ().Lookup ("service" ))
35
35
36
36
var dockerImageTag string
Original file line number Diff line number Diff line change
1
+ package cmd
2
+
3
+ import (
4
+ "fmt"
5
+
6
+ "github.com/spf13/cobra"
7
+ )
8
+
9
+ type Version struct {
10
+ Version string
11
+ Commit string
12
+ BuildTime string
13
+ }
14
+
15
+ var version * Version
16
+
17
+ var versionCmd = & cobra.Command {
18
+ Use : "version" ,
19
+ Short : "print the version number and exit" ,
20
+ Run : printVersion ,
21
+ }
22
+
23
+ func init () {
24
+ rootCmd .AddCommand (versionCmd )
25
+ }
26
+
27
+ func printVersion (cmd * cobra.Command , args []string ) {
28
+ fmt .Printf ("runecs %s\n " , version .Version )
29
+ }
30
+
31
+ func SetVersion (v * Version ) {
32
+ version = v
33
+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,18 @@ package main
16
16
17
17
import "runecs.io/v1/cmd"
18
18
19
+ var (
20
+ version = "No version provided"
21
+ commit = "No commit provided"
22
+ buildTime = "No build timestamp provided"
23
+ )
24
+
19
25
func main () {
26
+ cmd .SetVersion (& cmd.Version {
27
+ Version : version ,
28
+ Commit : commit ,
29
+ BuildTime : buildTime ,
30
+ })
31
+
20
32
cmd .Execute ()
21
33
}
You can’t perform that action at this time.
0 commit comments