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

ci: fix makefile docker ownership #1386

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Changes from 2 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
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ WEAVER_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="weaver" {print
SEMCONVGEN_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="semconvgen" {print $$2}')
OPA_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="opa" {print $$2}')

DOCKER_USER=$(shell id -u):$(shell id -g)


# TODO: add `yamllint` step to `all` after making sure it works on Mac.
.PHONY: all
Expand Down Expand Up @@ -114,7 +116,7 @@ yamllint:
.PHONY: table-generation
table-generation:
docker run --rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
-u $(DOCKER_USER) \
--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
--mount 'type=bind,source=$(PWD)/docs,target=/home/weaver/target' \
Expand All @@ -129,7 +131,7 @@ table-generation:
.PHONY: attribute-registry-generation
attribute-registry-generation:
docker run --rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
-u $(DOCKER_USER) \
--mount 'type=bind,source=$(PWD)/templates,target=/home/weaver/templates,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
--mount 'type=bind,source=$(PWD)/docs,target=/home/weaver/target' \
Expand Down Expand Up @@ -227,7 +229,7 @@ LATEST_RELEASED_SEMCONV_VERSION := $(shell git ls-remote --tags https://github.c
.PHONY: check-policies
check-policies:
docker run --rm \
-u $(id -u ${USER}):$(id -g ${USER}) \
-u $(DOCKER_USER) \
--mount 'type=bind,source=$(PWD)/policies,target=/home/weaver/policies,readonly' \
--mount 'type=bind,source=$(PWD)/model,target=/home/weaver/source,readonly' \
${WEAVER_CONTAINER} registry check \
Expand Down
Loading