Skip to content

Commit

Permalink
build image only if a Dockerfile is defined
Browse files Browse the repository at this point in the history
Signed-off-by: Maroun Touma <[email protected]>
  • Loading branch information
touma-I committed Nov 14, 2024
1 parent 1e810d0 commit fcbcc0a
Showing 1 changed file with 37 additions and 12 deletions.
49 changes: 37 additions & 12 deletions transforms/.make.modules
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,54 @@ test:: .transforms.test-src test-image

clean:: .transforms.clean

#image:: .transforms.ray-image
## We need to think how we want to do this going forward
set-versions::

## We need to think how we want to do this going forward
build::

image::
@if [ -e Dockerfile ]; then \
$(MAKE) image-default ; \
else \
echo "Skipping image for $(shell pwd) since no Dockerfile is present"; \
fi

publish::
@if [ -e Dockerfile ]; then \
$(MAKE) publish-default ; \
else \
echo "Skipping publish for $(shell pwd) since no Dockerfile is present"; \
fi

publish-image::
@if [ -e Dockerfile ]; then \
$(MAKE) publish-image-default ; \
else \
echo "Skipping publish-image for $(shell pwd) since no Dockerfile is present"; \
fi

test-image::
@if [ -e Dockerfile ]; then \
$(MAKE) test-image-default ; \
else \
echo "Skipping test-image for $(shell pwd) since no Dockerfile is present"; \
fi

test-src:: .transforms.test-src

setup:: .transforms.setup

publish:: publish-image
publish-default:: publish-image

publish-image:: .transforms.publish-image-ray
publish-image-default:: .transforms.publish-image-ray

test-image:: image .transforms.test-image-help .defaults.test-image-pytest .transforms.clean

set-versions::

## We need to think how we want to do this going forward
build::
test-image-default:: image .transforms.test-image-help .defaults.test-image-pytest .transforms.clean

build-lib-wheel:
make -C $(REPOROOT)/data-processing-lib build-pkg-dist

image:: build-lib-wheel
image-default:: build-lib-wheel
@$(eval LIB_WHEEL_FILE := $(shell find $(REPOROOT)/data-processing-lib/dist/*.whl))
rm -fr dist && mv $(REPOROOT)/data-processing-lib/dist .
$(eval WHEEL_FILE_NAME := $(shell basename $(LIB_WHEEL_FILE)))
Expand All @@ -60,6 +87,4 @@ image:: build-lib-wheel
$(DOCKER) tag $(DOCKER_LOCAL_IMAGE) $(DOCKER_REMOTE_IMAGE)
rm -fr dist

publish:: publish-image


0 comments on commit fcbcc0a

Please sign in to comment.