Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleimp committed Sep 10, 2020
1 parent 2157a78 commit e7451dd
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 9 deletions.
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,64 @@

Checks if any flags have expired an notifies someware

![CI](https://github.com/wesleimp/unleash-checkr/workflows/CI/badge.svg)
![CI](https://github.com/unleash/unleash-checkr/workflows/CI/badge.svg)

# Install

### Pre-compiled binary

**shell script**

```sh
curl -sf https://gobinaries.com/unleash/unleash-checkr | sh
```

**manually**

Download the pre-compiled binaries from the [releases page](https://github.com/unleash/unleash-checkr/releases) and copy to the desired location

### Compiling from source

Clone the repository

```sh
$ git clone git@github.com:unleash/unleash-checkr.git

$ cd gitignore
```

download dependencies

```sh
$ go mod download
```

build

```sh
$ go build -o unleash-checkr main.go
```

verify it works

```sh
$ unleash-checkr --help
```

# Usage

**check**

List overdue flags on terminal

```sh
$ unleash-checkr check -u "http://unleash.herokuapp.com"
```

**notify**

List overdue flags on terminal and notifies via Slack

```sh
$ unleash-checkr notify --channel "#checkr" --slack-token "my-token" --url "http://unleash.herokuapp.com" -e 60
```
7 changes: 2 additions & 5 deletions cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func Run(version string, args []string) error {
Flags: []cli.Flag{
&cli.StringFlag{
Name: "url",
Aliases: []string{"u"},
Usage: "unleash api url",
Required: true,
},
Expand Down Expand Up @@ -47,6 +48,7 @@ func Run(version string, args []string) error {
},
&cli.StringFlag{
Name: "url",
Aliases: []string{"u"},
Usage: "unleash api url",
Required: true,
},
Expand All @@ -56,11 +58,6 @@ func Run(version string, args []string) error {
Usage: "expires after days",
Value: 40,
},
&cli.BoolFlag{
Name: "silent",
Aliases: []string{"s"},
Usage: "silent mode doesn't print the flags on the console",
},
},
Action: runNotify,
},
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/slack-go/slack v0.6.5
github.com/stretchr/testify v1.6.1
github.com/tj/assert v0.0.3
github.com/urfave/cli/v2 v2.2.0
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 // indirect
)
4 changes: 2 additions & 2 deletions internal/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ func Start(ctx *context.Context) ([]flag.Flag, error) {
log.WithFields(log.Fields{
"url": ctx.Config.URL,
"expires": ctx.Config.Expires,
}).Info("Start check")
}).Debug("Start check")

ff, err := flag.Get(ctx)
if err != nil {
return nil, err
}

log.Info("Flags list")
log.Debug("Flags list")
fmt.Println()

var bold = color.New(color.Bold)
Expand Down

0 comments on commit e7451dd

Please sign in to comment.