Skip to content

Commit

Permalink
Merge pull request #1 from owncloud/basic-service
Browse files Browse the repository at this point in the history
  • Loading branch information
refs authored May 22, 2020
2 parents 0e9f379 + 81c06d3 commit 46ea310
Show file tree
Hide file tree
Showing 69 changed files with 15,267 additions and 302 deletions.
2 changes: 2 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ exclude_paths:
- changelog/**
- docs/**
- pkg/proto/**
- package.json
- rollup.config.js

...
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!bin/
35 changes: 33 additions & 2 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ def testing(ctx):
'arch': 'amd64',
},
'steps': [
{
'name': 'frontend',
'image': 'webhippie/nodejs:latest',
'pull': 'always',
'commands': [
'yarn install --frozen-lockfile',
'yarn lint',
'yarn test',
'yarn build',
],
},
{
'name': 'generate',
'image': 'webhippie/golang:1.13',
Expand Down Expand Up @@ -62,10 +73,10 @@ def testing(ctx):
},
{
'name': 'staticcheck',
'image': 'webhippie/golang:1.13',
'image': 'golangci/golangci-lint:latest',
'pull': 'always',
'commands': [
'make staticcheck',
'golangci-lint run',
],
'volumes': [
{
Expand Down Expand Up @@ -152,6 +163,17 @@ def docker(ctx, arch):
'arch': arch,
},
'steps': [
{
'name': 'frontend',
'image': 'webhippie/nodejs:latest',
'pull': 'always',
'commands': [
'yarn install --frozen-lockfile',
'yarn lint',
'yarn test',
'yarn build',
],
},
{
'name': 'generate',
'image': 'webhippie/golang:1.13',
Expand Down Expand Up @@ -290,6 +312,15 @@ def binary(ctx, name):
'arch': 'amd64',
},
'steps': [
{
'name': 'frontend',
'image': 'webhippie/nodejs:latest',
'pull': 'always',
'commands': [
'yarn install --frozen-lockfile',
'yarn build',
],
},
{
'name': 'generate',
'image': 'webhippie/golang:1.13',
Expand Down
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"es6": true,
"amd": true
},
"extends": [
"standard",
"plugin:vue/essential"
],
"parserOptions": {
"sourceType": "module"
},
"rules": {

}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverage.out

/node_modules
/assets
/ocis-settings-store
34 changes: 34 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
issues:
exclude-rules:
- path: pkg/proto/v0/settings.pb.go
text: "SA1019:"
linters:
- staticcheck
- path: pkg/store/filesystem/io.go
text: "SA1019:"
linters:
- staticcheck
linters:
enable:
- bodyclose
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- depguard
- golint
- goimports
- unconvert
- scopelint
- maligned
- misspell
# - gocritic
- prealloc
#- gosec

68 changes: 35 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ IMPORT := github.com/owncloud/$(NAME)
BIN := bin
DIST := dist
HUGO := hugo
PROTO_VERSION := v0
PROTO_SRC := pkg/proto/$(PROTO_VERSION)/*.proto

ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
Expand Down Expand Up @@ -69,9 +71,9 @@ fmt:
vet:
go vet $(PACKAGES)

.PHONY: staticcheck
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)
# .PHONY: staticcheck
# staticcheck:
# go run honnef.co/go/tools/cmd/staticcheck -tags '$(TAGS)' $(PACKAGES)

.PHONY: lint
lint:
Expand Down Expand Up @@ -155,41 +157,41 @@ docs: docs-copy docs-build
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=on go get -v github.com/micro/protoc-gen-micro/v2

# $(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/owncloud/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/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/settings.pb.go: pkg/proto/v0/settings.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--go_out=pkg/proto/v0 settings.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/settings.pb.micro.go: pkg/proto/v0/settings.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--micro_out=pkg/proto/v0 settings.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/settings.pb.web.go: pkg/proto/v0/settings.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--microweb_out=pkg/proto/v0 settings.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
pkg/proto/v0/settings.swagger.json: pkg/proto/v0/settings.proto
protoc \
-I=third_party/ \
-I=pkg/proto/v0/ \
--swagger_out=pkg/proto/v0 settings.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/example.pb.go pkg/proto/v0/example.pb.micro.go pkg/proto/v0/example.pb.web.go pkg/proto/v0/example.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/settings.pb.go pkg/proto/v0/settings.pb.micro.go pkg/proto/v0/settings.pb.web.go pkg/proto/v0/settings.swagger.json
25 changes: 25 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = function (api) {
api.cache(true)

const presets = [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: '3'
}
]
]
const plugins = [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-export-default-from'
]

return {
presets,
plugins
}
}
2 changes: 1 addition & 1 deletion cmd/ocis-settings/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ func main() {
if err := command.Execute(); err != nil {
os.Exit(1)
}
}
}
17 changes: 14 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@ require (
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/UnnoTed/fileb0x v1.1.4
github.com/go-chi/chi v4.1.0+incompatible
github.com/micro/cli/v2 v2.1.1
github.com/go-chi/render v1.0.1
github.com/golang/protobuf v1.4.0
github.com/grpc-ecosystem/grpc-gateway v1.14.4
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro/v2 v2.6.0
github.com/oklog/run v1.0.0
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/ocis-pkg/v2 v2.2.0
github.com/owncloud/ocis-hello v0.1.0-alpha1
github.com/owncloud/ocis-pkg/v2 v2.0.1
github.com/restic/calens v0.2.0
github.com/spf13/viper v1.5.0
github.com/spf13/viper v1.6.3
go.opencensus.io v0.22.2
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
google.golang.org/genproto v0.0.0-20200420144010-e5e8543f8aeb
google.golang.org/grpc v1.27.0
google.golang.org/protobuf v1.21.0
)

replace google.golang.org/grpc => google.golang.org/grpc v1.26.0
Loading

0 comments on commit 46ea310

Please sign in to comment.