-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7efd25a
Showing
257 changed files
with
56,817 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# bitrise-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.