Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Makefiles across folders #458

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 41 additions & 28 deletions inventory/Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all: buflint apilint bufgen doc

doc:
rm -rf ./google
rm -f ./v1/autogen.md
mkdir -p ./v1

# protoc doesn't include annotation and http googleapis, so we have to get them here
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api

docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}"/v1/:/out -w /out -v "${PWD}":/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

bufgen:
docker run --rm -v "${PWD}/..":/base -v "${PWD}":/out -w /out msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o v1
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

APIVER = v1

all: buflint apilint bufgen doc

doc:
rm -rf ./google
rm -f ./${APIVER}/autogen.md
mkdir -p ./${APIVER}

# protoc doesn't include annotation and http googleapis, so we have to get them here
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api

docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \
-v "${PWD}"/${APIVER}/:/out \
-w /out \
-v "${PWD}":/protos \
pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh \
-v "${PWD}":/out \
-w /out \
ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter /out/*.proto --output-format github --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}":/out -w /out bufbuild/buf lint

bufgen:
docker run --rm \
-v "${PWD}/..":/base \
-v "${PWD}":/out \
-w /out \
msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o ${APIVER}
32 changes: 26 additions & 6 deletions network/cloud/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,47 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

APIVER = v1alpha1

all: buflint apilint bufgen doc

doc:
rm -rf ./google
rm -rf ./v1alpha1/{autogen.md}
mkdir -p ./v1alpha1
rm -rf ./${APIVER}/{autogen.md}
mkdir -p ./${APIVER}

# protoc doesn't include annotation and http googleapis, so we have to get them here
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api

docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../opinetcommon":/opinetcommon -v "${PWD}"/v1alpha1/:/out -w /out -v "${PWD}":/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /opinetcommon -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \
-v "${PWD}/../opinetcommon":/opinetcommon \
-v "${PWD}"/${APIVER}/:/out \
-w /out \
-v "${PWD}":/protos \
pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /opinetcommon -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto"

rm -rf "${PWD}"/google

apilint:
curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh -v "${PWD}/../../network/opinetcommon":/common -v "${PWD}":/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0123 --disable-rule=core::0131 --disable-rule=core::0132 --disable-rule=core::0133 --disable-rule=core::0134 --disable-rule=core::0140 --disable-rule=core::0156 --disable-rule=core::0158 --disable-rule=core::0191 --disable-rule=core::0192 --disable-rule=core::0203 --disable-rule=core::0216 --disable-rule=client-libraries::4232::required-fields --set-exit-status"
docker run --user=$(id -u):$(id -g) --rm --entrypoint=sh \
-v "${PWD}/../../network/opinetcommon":/common \
-v "${PWD}":/out \
-w /out \
ghcr.io/docker-multiarch/google-api-linter:1.56.1 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0123 --disable-rule=core::0131 --disable-rule=core::0132 --disable-rule=core::0133 --disable-rule=core::0134 --disable-rule=core::0140 --disable-rule=core::0156 --disable-rule=core::0158 --disable-rule=core::0191 --disable-rule=core::0192 --disable-rule=core::0203 --disable-rule=core::0216 --disable-rule=client-libraries::4232::required-fields --set-exit-status"
rm -rf "${PWD}"/google

buflint:
docker run --rm -v "${PWD}/../opinetcommon":/opinnetcommon -v "${PWD}":/out -w /out bufbuild/buf lint
docker run --rm \
-v "${PWD}/../opinetcommon":/opinnetcommon \
-v "${PWD}":/out \
-w /out \
bufbuild/buf lint

bufgen:
docker run --rm -v "${PWD}/../opinetcommon":/opinnetcommon -v "${PWD}/../..":/base -v "${PWD}":/out -w /out msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o v1alpha1
docker run --rm \
-v "${PWD}/../opinetcommon":/opinnetcommon \
-v "${PWD}/../..":/base \
-v "${PWD}":/out \
-w /out \
msandersdell/bufbuild-go-gen:1.1.0 generate --template /base/buf.gen.yaml -o ${APIVER}
Loading
Loading