Skip to content

Commit

Permalink
Merge pull request #10 from cs3org/prototool-timeout
Browse files Browse the repository at this point in the history
Configure prototool timeout
  • Loading branch information
ishank011 authored Mar 17, 2021
2 parents dc54cec + b44e9e3 commit 65e9c24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt-get install python-pip -y

# deps for protoc
RUN cd /tmp && curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.9.2/protoc-3.9.2-linux-x86_64.zip -o protoc.zip && unzip -o protoc.zip && sudo cp bin/protoc /usr/local/bin/protoc
RUN cd /tmp && curl -sSL https://github.com/uber/prototool/releases/download/v1.8.0/prototool-Linux-x86_64 -o prototool && sudo cp prototool /usr/local/bin/ && sudo chmod u+x /usr/local/bin/prototool
RUN cd /tmp && curl -sSL https://github.com/uber/prototool/releases/download/v1.10.0/prototool-Linux-x86_64 -o prototool && sudo cp prototool /usr/local/bin/ && sudo chmod u+x /usr/local/bin/prototool
RUN cd /tmp && curl -sSL https://github.com/nilslice/protolock/releases/download/v0.14.1/protolock.20190917T024843Z.linux-amd64.tgz -o protolock.tgz && tar -xzf protolock.tgz && sudo cp protolock /usr/local/bin/
RUN curl -sSL https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.3.0/protoc-gen-doc-1.3.0.linux-amd64.go1.11.2.tar.gz -o protoc-gen-doc.tar.gz && tar xzfv protoc-gen-doc.tar.gz && sudo cp protoc-gen-doc-*/protoc-gen-doc /usr/local/bin/
RUN go install github.com/golang/protobuf/protoc-gen-go@v1.3.2
Expand Down
22 changes: 4 additions & 18 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ import (
"strings"
)

const (
// ProtobufVersion is the version of the protocol buffers.
ProtobufVersion = "3.7.1"
// PrototoolVersion specifies the version of the prototool.
PrototoolVersion = "1.6.0"
)

var (
// ProtoOS specifies the operative system for prototool.
ProtoOS = getProtoOS()
// ProtocFilename is the name of the protoc binary.
ProtocFilename = fmt.Sprintf("protoc-%s-%s-x86_64.zip", ProtobufVersion, ProtoOS)
)

var (
gitMail = flag.String("git-author-mail", "cs3org-bot@hugo.labkode.com", "Git author mail")
gitName = flag.String("git-author-name", "cs3org-bot", "Git author name")
Expand Down Expand Up @@ -290,7 +276,7 @@ func findFolders() []string {

func buildProto() {
dir := "."
cmd := exec.Command("prototool", "compile")
cmd := exec.Command("prototool", "compile", "--walk-timeout", "10s")
cmd.Dir = dir
run(cmd)

Expand All @@ -299,10 +285,10 @@ func buildProto() {
run(cmd)

// lint
cmd = exec.Command("prototool", "format", "-w")
cmd = exec.Command("prototool", "format", "-w", "--walk-timeout", "10s")
cmd.Dir = dir
run(cmd)
cmd = exec.Command("prototool", "lint")
cmd = exec.Command("prototool", "lint", "--walk-timeout", "10s")
cmd.Dir = dir
run(cmd)
cmd = exec.Command("go", "run", "tools/check-license/check-license.go")
Expand Down Expand Up @@ -340,7 +326,7 @@ func buildGo() {
// remove leftovers (existing defs)
os.RemoveAll("build/go-cs3apis/cs3")

cmd := exec.Command("prototool", "generate")
cmd := exec.Command("prototool", "generate", "--walk-timeout", "10s")
run(cmd)

sed("build/go-cs3apis", ".go", "github.com/cs3org/go-cs3apis/build/go-cs3apis/cs3/", "github.com/cs3org/go-cs3apis/cs3/")
Expand Down

0 comments on commit 65e9c24

Please sign in to comment.