2023-07-13 03:27:27 +00:00
|
|
|
IMAGE_NAME:=organic-test
|
2023-07-13 03:14:22 +00:00
|
|
|
# REMOTE_REPO:=harbor.fizz.buzz/private
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: build push
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2023-09-06 20:03:59 +00:00
|
|
|
docker build -t $(IMAGE_NAME) -f Dockerfile --target tester .
|
2023-09-06 19:54:25 +00:00
|
|
|
|
|
|
|
.PHONY: build_foreign_document_test
|
|
|
|
build_foreign_document_test:
|
2023-09-06 20:03:59 +00:00
|
|
|
docker build -t $(IMAGE_NAME)-foreign-document -f Dockerfile --target foreign-document-test .
|
2023-07-13 03:14:22 +00:00
|
|
|
|
|
|
|
.PHONY: push
|
|
|
|
push:
|
|
|
|
ifdef REMOTE_REPO
|
|
|
|
docker tag $(IMAGE_NAME) $(REMOTE_REPO)/$(IMAGE_NAME)
|
|
|
|
docker push $(REMOTE_REPO)/$(IMAGE_NAME)
|
|
|
|
else
|
|
|
|
@echo "REMOTE_REPO not defined, not pushing to a remote repo."
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
docker rmi $(IMAGE_NAME)
|
|
|
|
ifdef REMOTE_REPO
|
|
|
|
docker rmi $(REMOTE_REPO)/$(IMAGE_NAME)
|
|
|
|
else
|
|
|
|
@echo "REMOTE_REPO not defined, not removing from remote repo."
|
|
|
|
endif
|
2023-08-27 21:53:51 +00:00
|
|
|
docker volume rm rust-cache cargo-cache
|
2023-07-13 03:14:22 +00:00
|
|
|
|
|
|
|
.PHONY: run
|
2023-08-27 21:51:57 +00:00
|
|
|
run: build
|
2023-09-01 01:23:51 +00:00
|
|
|
docker run --rm --init --read-only --mount type=tmpfs,destination=/tmp -v "$$(readlink -f ../../):/source:ro" --workdir=/source --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target $(IMAGE_NAME) --no-default-features --features compare --no-fail-fast --lib --test test_loader
|
2023-07-13 03:14:22 +00:00
|
|
|
|
|
|
|
.PHONY: shell
|
2023-08-27 21:51:57 +00:00
|
|
|
shell: build
|
2023-09-01 01:23:51 +00:00
|
|
|
docker run --rm -i -t --entrypoint /bin/sh --mount type=tmpfs,destination=/tmp -v "$$(readlink -f ../../):/source:ro" --workdir=/source --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target $(IMAGE_NAME)
|
2023-09-06 19:54:25 +00:00
|
|
|
|
|
|
|
.PHONY: run_foreign_document_test
|
|
|
|
run_foreign_document_test: build_foreign_document_test
|
|
|
|
docker run --rm --init --read-only --mount type=tmpfs,destination=/tmp -v "$$(readlink -f ../../):/source:ro" --workdir=/source --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target $(IMAGE_NAME)-foreign-document
|