Fix make in_docker generate (#3616)

This commit is contained in:
Robert Kaussow 2024-04-15 17:46:44 +02:00 committed by GitHub
parent 21f87b4b1d
commit 781628816d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 42 additions and 31 deletions

View file

@ -90,7 +90,11 @@
"binutils", "binutils",
"nocolor", "nocolor",
"logfile", "logfile",
"Keyfunc" "Keyfunc",
"protoc",
"PROTOC",
"GOBIN",
"GOPATH"
], ],
"ignorePaths": [ "ignorePaths": [
"**/node_modules/**/*", "**/node_modules/**/*",

2
.mockery.yaml Normal file
View file

@ -0,0 +1,2 @@
---
disable-version-string: true

View file

@ -24,7 +24,7 @@ repos:
- id: checkmake - id: checkmake
exclude: '^docker/Dockerfile.make$' # actually a Dockerfile and not a makefile exclude: '^docker/Dockerfile.make$' # actually a Dockerfile and not a makefile
- repo: https://github.com/hadolint/hadolint - repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta rev: v2.12.0
hooks: hooks:
- id: hadolint - id: hadolint
- repo: https://github.com/pre-commit/mirrors-prettier - repo: https://github.com/pre-commit/mirrors-prettier

View file

@ -58,8 +58,6 @@ ifeq (in_docker,$(firstword $(MAKECMDGOALS)))
-e TARGETOS="$(TARGETOS)" \ -e TARGETOS="$(TARGETOS)" \
-e TARGETARCH="$(TARGETARCH)" \ -e TARGETARCH="$(TARGETARCH)" \
-e CGO_ENABLED="$(CGO_ENABLED)" \ -e CGO_ENABLED="$(CGO_ENABLED)" \
-e GOPATH=/tmp/go \
-e HOME=/tmp/home \
-v $(PWD):/build --rm woodpecker/make:local make $(MAKE_ARGS) -v $(PWD):/build --rm woodpecker/make:local make $(MAKE_ARGS)
else else
@ -110,7 +108,7 @@ clean-all: clean ## Clean all artifacts
rm -rf docs/docs/40-cli.md docs/swagger.json rm -rf docs/docs/40-cli.md docs/swagger.json
.PHONY: generate .PHONY: generate
generate: generate-swagger ## Run all code generations generate: install-tools generate-swagger ## Run all code generations
go generate ./... go generate ./...
generate-swagger: install-tools ## Run swagger code generation generate-swagger: install-tools ## Run swagger code generation
@ -137,6 +135,15 @@ install-tools: ## Install development tools
fi ; \ fi ; \
hash addlicense > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ hash addlicense > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install github.com/google/addlicense@latest; \ go install github.com/google/addlicense@latest; \
fi ; \
hash mockery > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install github.com/vektra/mockery/v2@latest; \
fi ; \
hash protoc-gen-go > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest; \
fi ; \
hash protoc-gen-go-grpc > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest; \
fi fi
ui-dependencies: ## Install UI dependencies ui-dependencies: ## Install UI dependencies

View file

@ -1,17 +1,19 @@
# docker build --rm -f docker/Dockerfile.make -t woodpecker/make:local . # docker build --rm -f docker/Dockerfile.make -t woodpecker/make:local .
FROM docker.io/golang:1.22-alpine3.18 as golang_image FROM docker.io/golang:1.22-alpine3.19 as golang_image
FROM docker.io/node:21-alpine3.18 FROM docker.io/node:21-alpine3.19
# renovate: datasource=repology depName=alpine_3_18/make versioning=loose # renovate: datasource=repology depName=alpine_3_19/make versioning=loose
ENV MAKE_VERSION="4.4.1-r1" ENV MAKE_VERSION="4.4.1-r2"
# renovate: datasource=repology depName=alpine_3_18/gcc versioning=loose # renovate: datasource=repology depName=alpine_3_19/gcc versioning=loose
ENV GCC_VERSION="12.2.1_git20220924-r10" ENV GCC_VERSION="13.2.1_git20231014-r0"
# renovate: datasource=repology depName=alpine_3_18/binutils-gold versioning=loose # renovate: datasource=repology depName=alpine_3_19/binutils-gold versioning=loose
ENV BINUTILS_GOLD_VERSION="2.40-r7" ENV BINUTILS_GOLD_VERSION="2.41-r0"
# renovate: datasource=repology depName=alpine_3_18/musl-dev versioning=loose # renovate: datasource=repology depName=alpine_3_19/musl-dev versioning=loose
ENV MUSL_DEV_VERSION="1.2.4-r2" ENV MUSL_DEV_VERSION="1.2.4_git20230717-r4"
# renovate: datasource=repology depName=alpine_3_19/protoc versioning=loose
ENV PROTOC_VERSION="24.4-r0"
RUN apk add --no-cache --update make=${MAKE_VERSION} gcc=${GCC_VERSION} binutils-gold=${BINUTILS_GOLD_VERSION} musl-dev=${MUSL_DEV_VERSION} && \ RUN apk add --no-cache --update make=${MAKE_VERSION} gcc=${GCC_VERSION} binutils-gold=${BINUTILS_GOLD_VERSION} musl-dev=${MUSL_DEV_VERSION} protoc=${PROTOC_VERSION} && \
corepack enable corepack enable
# Build packages. # Build packages.
@ -20,9 +22,12 @@ COPY Makefile /
ENV PATH=$PATH:/usr/local/go/bin ENV PATH=$PATH:/usr/local/go/bin
# Cache tools # Cache tools
RUN make install-tools && \ RUN GOBIN=/usr/local/go/bin make install-tools && \
mv /root/go/bin/* /usr/local/go/bin/ && \ rm -rf /Makefile
chmod 755 /usr/local/go/bin/*
ENV GOPATH=/tmp/go
ENV HOME=/tmp/home
ENV PATH=$PATH:/usr/local/go/bin:/tmp/go/bin
WORKDIR /build WORKDIR /build
RUN chmod -R 777 /root RUN chmod -R 777 /root

View file

@ -16,8 +16,3 @@ package proto
//go:generate protoc --go_out=paths=source_relative:. woodpecker.proto //go:generate protoc --go_out=paths=source_relative:. woodpecker.proto
//go:generate protoc --go-grpc_out=paths=source_relative:. woodpecker.proto //go:generate protoc --go-grpc_out=paths=source_relative:. woodpecker.proto
// install protoc: https://grpc.io/docs/protoc-installation/
// and get needed binary's:
// go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
// go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

View file

@ -15,8 +15,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.25.1 // protoc v4.24.4
// source: woodpecker.proto // source: woodpecker.proto
package proto package proto

View file

@ -16,7 +16,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.3.0 // - protoc-gen-go-grpc v1.3.0
// - protoc v4.25.1 // - protoc v4.24.4
// source: woodpecker.proto // source: woodpecker.proto
package proto package proto

View file

@ -15,7 +15,6 @@
package forge package forge
//go:generate go install github.com/vektra/mockery/v2@latest
//go:generate mockery --name Forge --output mocks --case underscore //go:generate mockery --name Forge --output mocks --case underscore
import ( import (

View file

@ -1,4 +1,4 @@
// Code generated by mockery v2.42.1. DO NOT EDIT. // Code generated by mockery. DO NOT EDIT.
package mocks package mocks

View file

@ -1,4 +1,4 @@
// Code generated by mockery v2.42.1. DO NOT EDIT. // Code generated by mockery. DO NOT EDIT.
package mocks package mocks

View file

@ -14,7 +14,6 @@
package store package store
//go:generate go install github.com/vektra/mockery/v2@latest
//go:generate mockery --name Store --output mocks --case underscore //go:generate mockery --name Store --output mocks --case underscore
import ( import (