Skip to content

Commit

Permalink
Adding utilities to run buf in Docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
andream16 committed Oct 14, 2024
1 parent a3ac4e8 commit 6e99f5a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 911 deletions.
32 changes: 22 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -311,23 +311,35 @@ dev-deploy: deploy-cluster dev-infra dev-dracon
dev-teardown:
@kind delete clusters dracon-demo

build_buf_container:
build-buf-container:
$(DOCKER) build . -t $(BUF_CONTAINER) -f containers/Dockerfile.buf

run_buf: build_buf_container
$(DOCKER) run --volume "$(shell pwd):/workspace" --workdir /workspace $(BUF_CONTAINER) $(ARGS)

fmt-proto: build_buf_container
run-buf: build-buf-container
$(eval BUF_TMP_DP_FOLDER:=buf-tmp)
@if [ ! -d "$(BUF_TMP_DP_FOLDER)" ]; then mkdir $(BUF_TMP_DP_FOLDER); fi
$(DOCKER) run \
--volume "$(shell pwd):/workspace" \
--volume $(BUF_TMP_DP_FOLDER):/tmp \
--workdir /workspace \
$(BUF_CONTAINER) \
$(ARGS)
@rm -rf $(BUF_TMP_DP_FOLDER)

fmt-proto: build-buf-container
@echo "Tidying up Proto files"
$(MAKE) run_buf ARGS="format -w"
$(MAKE) run-buf ARGS="format -w --exclude-path vendor/"

lint-proto: build_buf_container
lint-proto: build-buf-container
@echo "Linting Proto files"
$(MAKE) run_buf ARGS="lint --exclude-path vendor"
$(MAKE) run-buf ARGS="lint --exclude-path vendor/"

generate-proto: build_buf_container
generate-proto: build-buf-container
@echo "Generating Proto files"
$(MAKE) run_buf ARGS="generate"
$(MAKE) run-buf ARGS="generate"

dep-update-proto: build-buf-container
@echo "Updating buf.lock deps"
$(MAKE) run-buf ARGS="dep update"

########################################
########### RELEASE UTILITIES ##########
Expand Down
337 changes: 0 additions & 337 deletions api/proto/v1/engine.pb.go

This file was deleted.

Loading

0 comments on commit 6e99f5a

Please sign in to comment.