remove self from context to avoid races
This commit is contained in:
parent
0291039caf
commit
088bb4f08f
2 changed files with 4 additions and 3 deletions
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
self=${1}
|
||||
for each in $(find src/*/*/Containerfile); do
|
||||
package=$(basename $(dirname ${each}))
|
||||
digest_file=out/${package}/index.json
|
||||
digest_line=""
|
||||
[ "$package" == "$self" ] && continue
|
||||
if [ -e ${digest_file} ]; then
|
||||
printf -- ' --build-context %s=oci-layout://./out/%s' "${package}" "${package}"
|
||||
fi
|
||||
|
|
|
@ -44,7 +44,7 @@ define build
|
|||
$(if $(filter latest,$(VERSION)),,--build-arg VERSION=$(VERSION)) \
|
||||
--output type=oci,rewrite-timestamp=true,force-compression=true,name=$(NAME),annotation.org.opencontainers.image.revision=$(REVISION),annotation.org.opencontainers.image.version=$(VERSION),tar=false,dest=out/$(NAME) \
|
||||
--target $(TARGET) \
|
||||
$(shell ./src/context.sh) \
|
||||
$(shell ./src/context.sh $(NAME)) \
|
||||
$(EXTRA_ARGS) \
|
||||
$(NOCACHE_FLAG) \
|
||||
-f src/$(CATEGORY)/$(NAME)/Containerfile \
|
||||
|
@ -53,7 +53,7 @@ define build
|
|||
$(eval TIMESTAMP := $(shell TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ"))
|
||||
mkdir -p out/ \
|
||||
&& echo $(TIMESTAMP) $(BUILD_CMD) start >> out/build.log \
|
||||
&& rm -rf out/$(NAME)/* \
|
||||
&& rm -rf out/$(NAME) \
|
||||
&& $(BUILD_CMD) \
|
||||
&& echo $(TIMESTAMP) $(BUILD_CMD) end >> out/build.log;
|
||||
endef
|
||||
|
|
Loading…
Reference in a new issue