From 11044f0e7f779132b76daa6b6d2319cd5eda7380 Mon Sep 17 00:00:00 2001 From: Tira Date: Thu, 2 Nov 2023 09:37:55 +0800 Subject: [PATCH 1/7] Fix the build dockerfile. --- dockerfiles/Dockerfile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile.build b/dockerfiles/Dockerfile.build index 862c062a..7e617b4b 100644 --- a/dockerfiles/Dockerfile.build +++ b/dockerfiles/Dockerfile.build @@ -19,7 +19,7 @@ RUN go get github.com/mitchellh/gox && \ cp /go/bin/gox /usr/bin && \ rm -rf /go/src/* /go/pkg/* /go/bin/* -RUN go get -d github.com/golang/mock/mockgen && \ +RUN git clone https://github.com/golang/mock.git /go/src/github.com/golang/mock && \ cd /go/src/github.com/golang/mock && \ git checkout -q "v1.0.0" && \ go build -v -o /usr/local/bin/mockgen ./mockgen && \ From 1af7af96caa05265a2038b5fc6bfd426c8d43d53 Mon Sep 17 00:00:00 2001 From: Tira Date: Thu, 2 Nov 2023 09:54:25 +0800 Subject: [PATCH 2/7] Fixed the lint one. --- .pre-commit-config.yaml | 5 +++-- dockerfiles/Dockerfile.lint | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac240bb6..a6147167 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,5 @@ -- repo: git://github.com/pre-commit/pre-commit-hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks.git sha: v0.7.1 hooks: - id: check-merge-conflict @@ -14,7 +15,7 @@ - id: check-json exclude: '^vendor/' -- repo: git://github.com/dnephin/pre-commit-golang +- repo: https://github.com/dnephin/pre-commit-golang.git sha: v0.3.5 hooks: - id: golangci-lint diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index fb119379..e4e585fb 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -1,7 +1,7 @@ FROM golang:1.14-alpine RUN apk add -U python3 py-pip python3-dev musl-dev gcc git bash -RUN pip install --ignore-installed pre-commit +RUN pip install --ignore-installed 'pre-commit<3.0' COPY --from=golangci/golangci-lint:v1.24.0 /usr/bin/golangci-lint /usr/bin/golangci-lint From fb314fb94ec986d34e0b99a867d85fbc6a01ab73 Mon Sep 17 00:00:00 2001 From: Tira Date: Thu, 2 Nov 2023 14:35:26 +0800 Subject: [PATCH 3/7] Add safe.directory for avoiding git FatalError. --- dockerfiles/Dockerfile.lint | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index e4e585fb..90d398c1 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -7,7 +7,9 @@ COPY --from=golangci/golangci-lint:v1.24.0 /usr/bin/golangci-lint /usr/bin/go WORKDIR /go/src/github.com/dnephin/dobi COPY .pre-commit-config.yaml ./ -RUN git init && pre-commit install-hooks +RUN git init && \ + pre-commit install-hooks && \ + git config --global --add safe.directory /go/src/github.com/dnephin/dobi ENV CGO_ENABLED=0 CMD ["pre-commit", "run", "-a", "-v"] From 518e7fc8ec996597e9e31f6ac8edbb6c737fdf3d Mon Sep 17 00:00:00 2001 From: Tira Date: Thu, 2 Nov 2023 14:47:42 +0800 Subject: [PATCH 4/7] Using git clone instead of go get -d. --- dockerfiles/Dockerfile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/Dockerfile.build b/dockerfiles/Dockerfile.build index 7e617b4b..e0cf3bbf 100644 --- a/dockerfiles/Dockerfile.build +++ b/dockerfiles/Dockerfile.build @@ -2,14 +2,14 @@ FROM golang:1.13-alpine RUN apk add -U git bash curl tree ARG FILEWATCHER_SHA=v0.3.2 -RUN go get -d github.com/dnephin/filewatcher && \ +RUN git clone https://github.com/dnephin/filewatcher.git /go/src/github.com/dnephin/filewatcher && \ cd /go/src/github.com/dnephin/filewatcher && \ git checkout -q "$FILEWATCHER_SHA" && \ go build -v -o /usr/bin/filewatcher . && \ rm -rf /go/src/* /go/pkg/* /go/bin/* ARG GOTESTSUM=v0.4.0 -RUN go get -d gotest.tools/gotestsum && \ +RUN git clone https://github.com/gotestyourself/gotestsum.git /go/src/gotest.tools/gotestsum && \ cd /go/src/gotest.tools/gotestsum && \ git checkout -q "$GOTESTSUM" && \ go build -v -o /usr/bin/gotestsum . && \ From 23a1b3d2104bd19299bac8b38354cf3c16e65f55 Mon Sep 17 00:00:00 2001 From: Tira Date: Fri, 10 Nov 2023 09:30:15 +0800 Subject: [PATCH 5/7] Fixed the docs docker. --- dockerfiles/Dockerfile.docs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dockerfiles/Dockerfile.docs b/dockerfiles/Dockerfile.docs index 45686740..ca974521 100644 --- a/dockerfiles/Dockerfile.docs +++ b/dockerfiles/Dockerfile.docs @@ -1,8 +1,8 @@ -FROM alpine:3.10 +FROM golang:1.13-alpine RUN apk -U add \ - python \ - py-pip \ + python3 \ + py3-pip \ go \ bash \ git \ @@ -11,8 +11,12 @@ RUN apk -U add \ ENV GOPATH=/go RUN git config --global http.https://gopkg.in.followRedirects true -RUN go get github.com/dnephin/filewatcher && \ - cp /go/bin/filewatcher /usr/bin/ && \ + +ARG FILEWATCHER_SHA=v0.3.2 +RUN git clone https://github.com/dnephin/filewatcher.git /go/src/github.com/dnephin/filewatcher && \ + cd /go/src/github.com/dnephin/filewatcher && \ + git checkout -q "$FILEWATCHER_SHA" && \ + go build -v -o /usr/bin/filewatcher . && \ rm -rf /go/src/* /go/pkg/* /go/bin/* RUN pip install sphinx==1.4.5 From 496ac20cfe9535dcd5e77d410af21d138c106e0c Mon Sep 17 00:00:00 2001 From: Tira Date: Fri, 10 Nov 2023 14:11:54 +0800 Subject: [PATCH 6/7] Fixed the pip of docs docker. --- dockerfiles/Dockerfile.docs | 4 ++- dockerfiles/requirements.docs.in | 4 +++ dockerfiles/requirements.docs.txt | 49 +++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 dockerfiles/requirements.docs.in create mode 100644 dockerfiles/requirements.docs.txt diff --git a/dockerfiles/Dockerfile.docs b/dockerfiles/Dockerfile.docs index ca974521..ea09231a 100644 --- a/dockerfiles/Dockerfile.docs +++ b/dockerfiles/Dockerfile.docs @@ -19,7 +19,9 @@ RUN git clone https://github.com/dnephin/filewatcher.git /go/src/github.com/ go build -v -o /usr/bin/filewatcher . && \ rm -rf /go/src/* /go/pkg/* /go/bin/* -RUN pip install sphinx==1.4.5 +WORKDIR /pip +COPY requirements.docs.txt . +RUN pip install -r requirements.docs.txt WORKDIR /go/src/github.com/dnephin/dobi ENV PS1="# " diff --git a/dockerfiles/requirements.docs.in b/dockerfiles/requirements.docs.in new file mode 100644 index 00000000..a6af5eac --- /dev/null +++ b/dockerfiles/requirements.docs.in @@ -0,0 +1,4 @@ +sphinx==1.6.7 +markupsafe==0.23 +Jinja2<3 +docutils diff --git a/dockerfiles/requirements.docs.txt b/dockerfiles/requirements.docs.txt new file mode 100644 index 00000000..c6dadde7 --- /dev/null +++ b/dockerfiles/requirements.docs.txt @@ -0,0 +1,49 @@ +# +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: +# +# pip-compile dockerfiles/requirements.docs.in +# +alabaster==0.7.13 + # via sphinx +babel==2.13.1 + # via sphinx +certifi==2023.7.22 + # via requests +charset-normalizer==3.3.2 + # via requests +docutils==0.20.1 + # via + # -r dockerfiles/requirements.docs.in + # sphinx +idna==3.4 + # via requests +imagesize==1.4.1 + # via sphinx +jinja2==2.11.3 + # via + # -r dockerfiles/requirements.docs.in + # sphinx +markupsafe==0.23 + # via + # -r dockerfiles/requirements.docs.in + # jinja2 +pygments==2.16.1 + # via sphinx +requests==2.31.0 + # via sphinx +six==1.15.0 + # via sphinx +snowballstemmer==2.2.0 + # via sphinx +sphinx==1.6.7 + # via -r dockerfiles/requirements.docs.in +sphinxcontrib-serializinghtml==1.1.5 + # via sphinxcontrib-websupport +sphinxcontrib-websupport==1.2.4 + # via sphinx +urllib3==2.0.7 + # via requests + +# The following packages are considered to be unsafe in a requirements file: +# setuptools From e1b4e7f09da8477d5de10beeb3ed52de8a659e68 Mon Sep 17 00:00:00 2001 From: Tira Date: Fri, 10 Nov 2023 14:32:11 +0800 Subject: [PATCH 7/7] Removed cp in circleci. --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8cb10a06..4d64ac38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -90,7 +90,6 @@ jobs: - run: name: "Run example tests" command: | - cp -r "$DOCKER_CERT_PATH" ./circleci-certs script/ci/step dobi test-examples - store_artifacts: path: _results