Skip to content

Commit

Permalink
fix(circle): Re enable generate
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>

chore(gen): make generate_local

Signed-off-by: Sacha Froment <sfroment42@gmail.com>

fix(dockerfile): fix version of gqlgen

Signed-off-by: Sacha Froment <sfroment42@gmail.com>

fix(generate): fix generate command

Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment authored and moul committed Aug 30, 2018
1 parent 7f59826 commit 875a153
Show file tree
Hide file tree
Showing 18 changed files with 1,593 additions and 2,193 deletions.
27 changes: 11 additions & 16 deletions .circleci/config.yml
Expand Up @@ -34,34 +34,29 @@ jobs:

generate:
docker:
- image: bertychat/protoc
- image: bertychat/protoc:latest
working_directory: /go/src/berty.tech
environment:
GOPATH: /go
steps:
- checkout
- setup_remote_docker
- run:
name: update dev deps
name: cleanup existing generated files
command: |
cd core
make dev-deps
make clean
- run:
name: cleanup existing generated files
name: make generate_local
command: |
cd core
make clean
#- run:
# name: make generate
# command: |
# cd core
# make generate
#- run:
# name: check if files changed
# command: |
# git status | cat
# git diff | cat
# git diff-index --quiet HEAD --
make generate_local
- run:
name: check if files changed
command: |
git status | cat
git diff | cat
git diff-index --quiet HEAD --
docker.build:
docker:
Expand Down
17 changes: 7 additions & 10 deletions .circleci/docker/Dockerfile.protoc
@@ -1,14 +1,8 @@
FROM znly/protoc as znly
FROM moul/protoc-gen-gotemplate

#FROM golang:1.10-alpine
RUN apk --update add make git go rsync libc-dev openssh docker

RUN apk --update add make git go rsync libc-dev openssh

RUN go version

#COPY --from=znly

RUN go get -u -v \
RUN go get -u -v \
github.com/gogo/protobuf/proto \
github.com/gogo/protobuf/protoc-gen-gogo \
github.com/gogo/protobuf/gogoproto \
Expand All @@ -17,7 +11,10 @@ RUN go get -u -v \
github.com/moul/protoc-gen-gotemplate \
golang.org/x/tools/cmd/goimports \
github.com/99designs/gqlgen \
github.com/vektah/gorunpkg
github.com/vektah/gorunpkg \
github.com/spf13/cobra

RUN cd /go/src/github.com/99designs/gqlgen && git checkout v0.4.4 && go install github.com/99designs/gqlgen

ENV GOPATH=/go \
PATH=/go/bin:${PATH}
18 changes: 4 additions & 14 deletions core/Makefile
Expand Up @@ -20,16 +20,6 @@ TEST_PATHS ?= ./...
TEST_CMD ?= $(BUILD_ENV) go test -test.timeout 3m -v $(TEST_PATHS)
PROTOC ?= protoc
GQLGEN ?= gqlgen
DOCKER_PROTOC = docker run --user="$(shell id -u)" --rm -v "$(GOPATH)/src:/go/src" -v "$(PWD)/..:/go/src/github.com/berty/berty" -w "/go/src/github.com/berty/berty/core" bertychat/protoc protoc
DOCKER_GQLGEN = docker run --user="$(shell id -u)" --rm -v "$(GOPATH)/src:/go/src" -v "$(PWD)/..:/go/src/github.com/berty/berty" -w "/go/src/github.com/berty/berty/core" bertychat/protoc gqlgen
ifeq (, $(shell which protoc))
PROTOC=$(DOCKER_PROTOC)
GQLGEN=$(DOCKER_GQLGEN)
endif
ifeq (1, $(USE_DOCKER))
PROTOC=$(DOCKER_PROTOC)
GQLGEN=$(DOCKER_GQLGEN)
endif

##
## phonies
Expand All @@ -52,7 +42,7 @@ run: $(BIN)
.PHONY: install
install: $(BIN)

$(BIN): generate $(SOURCES)
$(BIN): generate_local $(SOURCES)
$(BUILD_ENV) go install -v ./cmd/...

.PHONY: testwatch
Expand All @@ -63,7 +53,7 @@ testwatch:
while true; do watchman-wait . -p "**/*.go"; clear; $(TEST_CMD); sleep .3; done

.PHONY: test
test: generate
test: generate_local
$(TEST_CMD)

.PHONY: integration
Expand All @@ -82,8 +72,8 @@ lint: generate
clean:
rm -f $(GENERATED_FILES) $(BIN)

.PHONY: generate
generate: $(GENERATED_FILES)
.PHONY: generate_local
generate_local: $(GENERATED_FILES)

.PHONY: _ci_prepare
_ci_prepare:
Expand Down

0 comments on commit 875a153

Please sign in to comment.