Interested in contributing to Spinnaker? Please review the contribution documentation.
Clone the repository to a directory outside of your GOPATH:
$ git clone https://github.com/spinnaker/spin
Afterward, use go build
to build the program. This will automatically fetch dependencies.
$ go build
Upon first build, you may see output while the go
tool fetches dependencies.
To verify dependencies match checksums under go.sum, run go mod verify
.
To clean up any old, unused go.mod or go.sum lines, run go mod tidy
.
Run using
./spin <cmds> <flags>
Test using
go test -v ./...
from the root spin/
directory.
Spin CLI uses Swagger to generate the API client library for Gate. To update the client library:
- From the root of the Gate directory, execute
swagger/generate_swagger.sh
to create theswagger.json
API spec. - Get the Swagger Codegen CLI. Use the version specified here.
- Remove the existing generated code from the spin directory
rm -r ~/spin/gateapi
- Use the Swagger Codegen CLI to generate the new library and drop it into the spin project
java -jar ~/swagger-codegen-cli.jar generate -i ~/gate/swagger/swagger.json -l go -o ~/spin/gateapi
- Commit the changes and open a PR.