This is Zally's cli tool: it reads a swagger file locally and lints it by requesting violations check at a given Zally server.
-
Follow Go installation instructions
-
Make sure that
$GOPATH
variable is set (and$GOROOT
if necessary) -
Clone the repository:
git clone [email protected]:zalando/zally.git $GOPATH/src/github.com/zalando/zally
-
Install golang/dep:
go get -u github.com/golang/dep/cmd/dep
-
Get dependencies:
cd $GOPATH/src/github.com/zalando/zally/cli/zally dep ensure
-
Run tests:
cd $GOPATH/src/github.com/zalando/zally/cli/zally ./test.sh
-
Build the binary:
cd $GOPATH/src/github.com/zalando/zally/cli/zally go build
To launch zally-cli
, run the following command:
zally lint swagger_definition.yml
By default zally-cli
uses API located at http://localhost:8080/ and no security
token. You can provide alternative settings using either environment variables
ZALLY_URL
and TOKEN
:
export ZALLY_URL="http://zally.example.com/"
export TOKEN="f123-4567-890a-bcde"
zally lint swagger_definition.yml
or --linter-service
and --token
command-line arguments:
zally swagger_definition.yml --linter-service "http://zally.example.com/" --token "f123-4567-890a-bcde"
To get commands help message, simply type:
zally --help
To get the list of enabled rules, please run:
zally rules
-
Install
goreleaser
tool:go get -v github.com/goreleaser/goreleaser cd $GOPATH/src/github.com/goreleaser/goreleaser go install
Alternatively you can download a latest release from goreleaser Releases Page
-
Clean up folder
cli/zally/dist
if exists -
Make sure that the repository state is clean:
git status
-
Tag the release:
git tag v1.1.0
-
Run
goreleaser
:cd cli/zally goreleaser --skip-publish v1.1.0
-
Check builds inside
cli/zally/dist
directory. -
Publish release tag to GitHub:
git push origin v1.1.0