Skip to content

Commit

Permalink
docs: simple access check guide (#451)
Browse files Browse the repository at this point in the history
This also enables gRPC go, gRPC nodejs, cURL, and Keto CLI code samples to be tested.
  • Loading branch information
zepatrik authored Feb 19, 2021
1 parent 7a0fcfc commit e0485af
Show file tree
Hide file tree
Showing 36 changed files with 13,345 additions and 57 deletions.
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ orbs:
slack: circleci/[email protected]
nancy: ory/[email protected]
docs: ory/[email protected]
golangci: ory/[email protected].9
golangci: ory/[email protected].13

jobs:
test:
docker:
-
image: circleci/golang:1.15
image: cimg/go:1.15-node
environment:
TEST_DATABASE_POSTGRESQL: postgres://test:test@localhost:5432/keto?sslmode=disable
TEST_DATABASE_MYSQL: mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true
Expand All @@ -31,10 +31,10 @@ jobs:
-
image: cockroachdb/cockroach:v20.2.4
command: start-single-node --insecure
working_directory: /go/src/github.com/ory/keto
steps:
- checkout
- setup_remote_docker
- run: sudo npm i -g npm@7
# Installation
-
run: go mod verify
Expand All @@ -52,16 +52,20 @@ jobs:
# Submit coverage details
-
run: test -z "$CIRCLE_PR_NUMBER" && goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN || echo "forks are not allowed to push to coveralls"

# Test documentation examples
-
run: make test-docs-samples
validate:
docker:
- image: circleci/golang:1.15-node
- image: cimg/go:1.15-node
environment:
GO111MODULE: 'on'
working_directory: /go/src/github.com/ory/keto
steps:
- checkout
- golangci/lint
- docs/check-format
- run: npm ci && npm run format:check

workflows:
version: 2
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ifneq ("$(shell base64 Makefile) $(shell base64 go.mod) $(shell base64 go.sum)",
go build -o .bin/buf github.com/bufbuild/buf/cmd/buf
go build -o .bin/protoc-gen-go google.golang.org/protobuf/cmd/protoc-gen-go
go build -o .bin/protoc-gen-go-grpc google.golang.org/grpc/cmd/protoc-gen-go-grpc
npm i -g [email protected]
npm i
echo "v0" > .bin/.lock
echo "$$(base64 Makefile) $$(base64 go.mod) $$(base64 go.sum)" > .bin/.lock
Expand Down Expand Up @@ -99,3 +98,11 @@ reset-testdb:
.PHONY: test-e2e
test-e2e:
go test -tags sqlite -failfast -v ./internal/e2e

.PHONY: test-docs-samples
test-docs-samples:
cd ./contrib/docs-code-samples \
&& \
npm i \
&& \
npm test
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins:
- name: js-grpc
out: proto
opt: grpc_js,binary,import_style=commonjs
path: grpc_tools_node_protoc_plugin
path: node_modules/.bin/grpc_tools_node_protoc_plugin
- name: ts
out: proto
opt: ts_out=proto
Expand Down
10 changes: 4 additions & 6 deletions contrib/cat-videos-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ services:
keto:
image: oryd/keto:latest
ports:
- "4466:4466"
- "4467:4467"
command:
serve -c /home/ory/keto.yml
- '4466:4466'
- '4467:4467'
command: serve -c /home/ory/keto.yml
restart: on-failure
volumes:
- type: bind
Expand All @@ -22,6 +21,5 @@ services:
- type: bind
source: .
target: /home/ory
command:
relation-tuple create /home/ory/relation-tuples
command: relation-tuple create /home/ory/relation-tuples
restart: on-failure
1 change: 1 addition & 0 deletions contrib/docs-code-samples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
Loading

0 comments on commit e0485af

Please sign in to comment.