cli/

directory
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2018 License: MIT

README

Zally Command Line Interface

This is Zally's cli tool: it reads a swagger file locally and lints it by requesting violations check at a given Zally server.

Building from sources

  1. Follow Go installation instructions

  2. Make sure that $GOPATH variable is set (and $GOROOT if necessary)

  3. Clone the repository:

    git clone [email protected]:zalando/zally.git $GOPATH/src/github.com/zalando/zally
    
  4. Install golang/dep:

    go get -u github.com/golang/dep/cmd/dep
    
  5. Get dependencies:

    cd $GOPATH/src/github.com/zalando/zally/cli/zally
    dep ensure
    
  6. Run tests:

    cd $GOPATH/src/github.com/zalando/zally/cli/zally
    ./test.sh
    
  7. Build the binary:

    cd $GOPATH/src/github.com/zalando/zally/cli/zally
    go build
    

Usage

Basic example

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"
Getting help message

To get commands help message, simply type:

zally --help
Getting the list of rules

To get the list of enabled rules, please run:

zally rules

Release it

  1. 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

  2. Clean up folder cli/zally/dist if exists

  3. Make sure that the repository state is clean:

    git status
    
  4. Tag the release:

    git tag v1.1.0
    
  5. Run goreleaser:

    cd cli/zally
    goreleaser --skip-publish v1.1.0
    
  6. Check builds inside cli/zally/dist directory.

  7. Publish release tag to GitHub:

    git push origin v1.1.0
    

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL