Skip to content

Commit

Permalink
Restructure based on hello reference
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Dec 6, 2019
1 parent ac202d5 commit dfa78af
Show file tree
Hide file tree
Showing 53 changed files with 773 additions and 3,040 deletions.
8 changes: 8 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
exclude_paths:
- CHANGELOG.md
- changelog/**
- docs/**
- pkg/proto/**

...
98 changes: 70 additions & 28 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ def testing(ctx):
'arch': 'amd64',
},
'steps': [
{
'name': 'generate',
'image': 'webhippie/golang:1.13',
'pull': 'always',
'commands': [
'make generate',
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app',
},
],
},
{
'name': 'vet',
'image': 'webhippie/golang:1.13',
Expand All @@ -46,34 +60,34 @@ def testing(ctx):
},
],
},
# {
# 'name': 'staticcheck',
# 'image': 'webhippie/golang:1.13',
# 'pull': 'always',
# 'commands': [
# 'make staticcheck',
# ],
# 'volumes': [
# {
# 'name': 'gopath',
# 'path': '/srv/app',
# },
# ],
# },
# {
# 'name': 'lint',
# 'image': 'webhippie/golang:1.13',
# 'pull': 'always',
# 'commands': [
# 'make lint',
# ],
# 'volumes': [
# {
# 'name': 'gopath',
# 'path': '/srv/app',
# },
# ],
# },
{
'name': 'staticcheck',
'image': 'webhippie/golang:1.13',
'pull': 'always',
'commands': [
'make staticcheck',
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app',
},
],
},
{
'name': 'lint',
'image': 'webhippie/golang:1.13',
'pull': 'always',
'commands': [
'make lint',
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app',
},
],
},
{
'name': 'build',
'image': 'webhippie/golang:1.13',
Expand Down Expand Up @@ -138,6 +152,20 @@ def docker(ctx, arch):
'arch': arch,
},
'steps': [
{
'name': 'generate',
'image': 'webhippie/golang:1.13',
'pull': 'always',
'commands': [
'make generate',
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app',
},
],
},
{
'name': 'build',
'image': 'webhippie/golang:1.13',
Expand Down Expand Up @@ -262,6 +290,20 @@ def binary(ctx, name):
'arch': 'amd64',
},
'steps': [
{
'name': 'generate',
'image': 'webhippie/golang:1.13',
'pull': 'always',
'commands': [
'make generate',
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app',
},
],
},
{
'name': 'build',
'image': 'webhippie/golang:1.13',
Expand Down
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repository:
name: ocis-graph
description: ':atom_symbol: Graph API Service for OCIS'
description: ':atom_symbol: Serve Graph API for oCIS'
homepage: https://owncloud.github.io/ocis-graph/
topics: reva, ocis

Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ coverage.out

/bin
/dist

/node_modules
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ The following sections list the changes for unreleased.

## Summary

* Chg #1: Initial release of basic version
* Chg #7: Initial release of basic version

## Details

* Change #1: Initial release of basic version
* Change #7: Initial release of basic version

Just prepared an initial basic version to serve a graph world API that also provides a Phoenix
extension to demonstrate the plugin architecture in combination with Phoenix and ownCloud
Infinite Scale.
Just prepare an initial basic version to serve a graph world API that can be used by Phoenix or
other extensions.

https://github.com/owncloud/ocis-graph/issues/1
https://github.com/owncloud/ocis-graph/issues/7


70 changes: 38 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ endif

PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
GENERATE ?= $(PACKAGES)

TAGS ?=

Expand Down Expand Up @@ -48,6 +49,7 @@ sync:
.PHONY: clean
clean:
go clean -i ./...
rm -rf $(BIN) $(DIST)

.PHONY: fmt
fmt:
Expand All @@ -65,6 +67,10 @@ staticcheck:
lint:
for PKG in $(PACKAGES); do go run golang.org/x/lint/golint -set_exit_status $$PKG || exit 1; done;

.PHONY: generate
generate:
go generate $(GENERATE)

.PHONY: changelog
changelog:
go run github.com/restic/calens >| CHANGELOG.md
Expand All @@ -81,10 +87,10 @@ install: $(SOURCES)
build: $(BIN)/$(EXECUTABLE) $(BIN)/$(EXECUTABLE)-debug

$(BIN)/$(EXECUTABLE): $(SOURCES)
go build -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
go build -i -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)

$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
go build -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
go build -i -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)

.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
Expand Down Expand Up @@ -124,41 +130,41 @@ docs:
watch:
go run github.com/cespare/reflex -c reflex.conf

$(GOPATH)/bin/protoc-gen-go:
GO111MODULE=off go get -v github.com/golang/protobuf/protoc-gen-go
# $(GOPATH)/bin/protoc-gen-go:
# GO111MODULE=off go get -v github.com/golang/protobuf/protoc-gen-go

$(GOPATH)/bin/protoc-gen-micro:
GO111MODULE=off go get -v github.com/micro/protoc-gen-micro
# $(GOPATH)/bin/protoc-gen-micro:
# GO111MODULE=off go get -v github.com/micro/protoc-gen-micro

$(GOPATH)/bin/protoc-gen-microweb:
GO111MODULE=off go get -v github.com/webhippie/protoc-gen-microweb
# $(GOPATH)/bin/protoc-gen-microweb:
# GO111MODULE=off go get -v github.com/webhippie/protoc-gen-microweb

$(GOPATH)/bin/protoc-gen-swagger:
GO111MODULE=off go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
# $(GOPATH)/bin/protoc-gen-swagger:
# GO111MODULE=off go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger

pkg/proto/v0/graph.pb.go: pkg/proto/v0/graph.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--go_out=logtostderr=true:pkg/proto/v0 graph.proto
# pkg/proto/v0/example.pb.go: pkg/proto/v0/example.proto
# protoc \
# -I=third_party/ \
# -I=pkg/proto/v0/ \
# --go_out=logtostderr=true:pkg/proto/v0 example.proto

pkg/proto/v0/graph.pb.micro.go: pkg/proto/v0/graph.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--micro_out=logtostderr=true:pkg/proto/v0 graph.proto
# pkg/proto/v0/example.pb.micro.go: pkg/proto/v0/example.proto
# protoc \
# -I=third_party/ \
# -I=pkg/proto/v0/ \
# --micro_out=logtostderr=true:pkg/proto/v0 example.proto

pkg/proto/v0/graph.pb.web.go: pkg/proto/v0/graph.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--microweb_out=logtostderr=true:pkg/proto/v0 graph.proto
# pkg/proto/v0/example.pb.web.go: pkg/proto/v0/example.proto
# protoc \
# -I=third_party/ \
# -I=pkg/proto/v0/ \
# --microweb_out=logtostderr=true:pkg/proto/v0 example.proto

pkg/proto/v0/graph.swagger.json: pkg/proto/v0/graph.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--swagger_out=logtostderr=true:pkg/proto/v0 graph.proto
# pkg/proto/v0/example.swagger.json: pkg/proto/v0/example.proto
# protoc \
# -I=third_party/ \
# -I=pkg/proto/v0/ \
# --swagger_out=logtostderr=true:pkg/proto/v0 example.proto

.PHONY: protobuf
protobuf: $(GOPATH)/bin/protoc-gen-go $(GOPATH)/bin/protoc-gen-micro $(GOPATH)/bin/protoc-gen-microweb $(GOPATH)/bin/protoc-gen-swagger pkg/proto/v0/graph.pb.go pkg/proto/v0/graph.pb.micro.go pkg/proto/v0/graph.pb.web.go pkg/proto/v0/graph.swagger.json
# .PHONY: protobuf
# protobuf: $(GOPATH)/bin/protoc-gen-go $(GOPATH)/bin/protoc-gen-micro $(GOPATH)/bin/protoc-gen-microweb $(GOPATH)/bin/protoc-gen-swagger pkg/proto/v0/example.pb.go pkg/proto/v0/example.pb.micro.go pkg/proto/v0/example.pb.web.go pkg/proto/v0/example.swagger.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ownCloud Infinite Scale: graph
# ownCloud Infinite Scale: Graph

[![Build Status](https://cloud.drone.io/api/badges/owncloud/ocis-graph/status.svg)](https://cloud.drone.io/owncloud/ocis-graph)
[![Gitter chat](https://badges.gitter.im/cs3org/reva.svg)](https://gitter.im/cs3org/reva)
Expand Down
Empty file added changelog/unreleased/.keep
Empty file.
7 changes: 3 additions & 4 deletions changelog/unreleased/initial-release.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Change: Initial release of basic version

Just prepared an initial basic version to serve a graph world API that also
provides a Phoenix extension to demonstrate the plugin architecture in
combination with Phoenix and ownCloud Infinite Scale.
Just prepare an initial basic version to serve a graph world API that can be
used by Phoenix or other extensions.

https://github.com/owncloud/ocis-graph/issues/1
https://github.com/owncloud/ocis-graph/issues/7
8 changes: 4 additions & 4 deletions config/example.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"debug": {
"addr": "0.0.0.0:8390",
"addr": "0.0.0.0:9124",
"token": "",
"pprof": false
"pprof": false,
"zpages": false
},
"http": {
"addr": "0.0.0.0:8380",
"root": "/"
"addr": "0.0.0.0:9120"
},
"tracing": {
"enabled": false,
Expand Down
8 changes: 4 additions & 4 deletions config/example.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
debug:
addr: 0.0.0.0:8390
addr: 0.0.0.0:9124
token:
pprof: false
zpages: false

server:
addr: 0.0.0.0:8380
root: /
http:
addr: 0.0.0.0:9120

tracing:
enabled: false
Expand Down
4 changes: 3 additions & 1 deletion docker/Dockerfile.linux.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf

LABEL maintainer="ownCloud GmbH <[email protected]>" \
org.label-schema.name="oCIS graph" \
org.label-schema.name="oCIS Graph" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"

EXPOSE 9120 9124

ENTRYPOINT ["/usr/bin/ocis-graph"]
CMD ["server"]

Expand Down
4 changes: 3 additions & 1 deletion docker/Dockerfile.linux.arm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf

LABEL maintainer="ownCloud GmbH <[email protected]>" \
org.label-schema.name="oCIS graph" \
org.label-schema.name="oCIS Graph" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"

EXPOSE 9120 9124

ENTRYPOINT ["/usr/bin/ocis-graph"]
CMD ["server"]

Expand Down
4 changes: 3 additions & 1 deletion docker/Dockerfile.linux.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf

LABEL maintainer="ownCloud GmbH <[email protected]>" \
org.label-schema.name="oCIS graph" \
org.label-schema.name="oCIS Graph" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"

EXPOSE 9120 9124

ENTRYPOINT ["/usr/bin/ocis-graph"]
CMD ["server"]

Expand Down
4 changes: 2 additions & 2 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baseURL = "https://owncloud.github.io/ocis-graph/"
languageCode = "en-us"
title = "ownCloud Infinite Scale: graph"
title = "ownCloud Infinite Scale: Graph"
pygmentsUseClasses = true

disableKinds = ["taxonomy", "taxonomyTerm", "RSS", "sitemap"]
Expand All @@ -14,5 +14,5 @@ disableKinds = ["taxonomy", "taxonomyTerm", "RSS", "sitemap"]

[params]
author = "ownCloud GmbH"
description = "Example service for Reva/oCIS"
description = "Serve Graph API for oCIS"
keywords = "reva, ocis"
2 changes: 1 addition & 1 deletion docs/content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ anchor: "about"
weight: 10
---

This service provides a simple graph world example API to show the integration of custom plugins within [Phoenix](https://github.com/owncloud/phoenix).
This service provides a simple graph world API which can be used by clients or other extensions.
Loading

0 comments on commit dfa78af

Please sign in to comment.