Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cstaud committed Mar 26, 2021
0 parents commit 7efd25a
Show file tree
Hide file tree
Showing 257 changed files with 56,817 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

.idea
# Dependency directories (remove the comment below to include it)
# vendor/
/.gobincache/

/swagger_patched_flat.json
/swagger_patched_go.json
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.PHONY: all build deps download generate help test validate
CHECK_FILES?=$$(go list ./... | grep -v /vendor/)
SWAGGER_SPEC=swagger.json
PATCH_FILE=staffbase.patch
PATCHED_SWAGGER_SPEC=swagger_patched.json

help: ## Show this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

all: download patch deps generate build test ## Validate the swagger spec, generate the code and build it.

build: ## Build the API Go client.
go build ./go/...

deps: ## Download dependencies.
GO111MODULE=off go get -u github.com/myitcv/gobin && go mod download

download: ## Download bitrise swagger specification
wget -q -O $(SWAGGER_SPEC) https://api-docs.bitrise.io/docs/swagger.json

patch: ## Apply swagger.json patches
patch -u $(SWAGGER_SPEC) -i $(PATCH_FILE) -o $(PATCHED_SWAGGER_SPEC)

generate: validate ## Generate the API Go client and the JSON document for the UI.
go generate

test: ## Test the go code.
gobin -m -run github.com/kyoh86/richgo test -v $(CHECK_FILES)

validate: deps ## Check that the swagger spec is valid.
gobin -m -run github.com/go-swagger/go-swagger/cmd/[email protected] validate $(PATCHED_SWAGGER_SPEC)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# bitrise-api
6 changes: 6 additions & 0 deletions generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package tools

// todo: Find a better way to ignore tags or make a breaking release
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger flatten swagger_patched.json -o swagger_patched_flat.json
//go:generate sh -c "cat swagger_patched_flat.json | jq '[., (.paths | map_values(.[] |= del(.tags?)) | {paths: .})] | add' > swagger_patched_go.json"
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger generate client -A bitrise-api -f swagger_patched_go.json -t go --default-scheme=https --with-flatten=full
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/Staffbase/bitrise-api

go 1.15

require (
github.com/go-openapi/errors v0.19.9
github.com/go-openapi/runtime v0.19.26
github.com/go-openapi/strfmt v0.20.0
github.com/go-openapi/swag v0.19.13
github.com/go-openapi/validate v0.20.1
github.com/go-swagger/go-swagger v0.26.1 // indirect
github.com/kyoh86/richgo v0.3.6 // indirect
)
1,047 changes: 1,047 additions & 0 deletions go.sum

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions go/client/bitrise_api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

196 changes: 196 additions & 0 deletions go/client/operations/activity_list_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7efd25a

Please sign in to comment.