diff --git a/Makefile b/Makefile index 28dabf02..2df6e738 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,23 @@ -.PHONY: clean images image2 image3 launch notebook2 notebook3 package dist test dist run shell shell2 shell3 dist-run dist-run2 dist-run3 +.PHONY: clean images image% launch notebook% package dist run test test% shell shell% dist-run dist-run% NB_UID=$(shell id -u) NB_GID=$(shell id -g) -PY2=rstudio/rsconnect-jupyter-py2 -PY3=rstudio/rsconnect-jupyter-py3 +IMAGE=rstudio/rsconnect-jupyter-py clean: rm -rf build/ dist/ rsconnect.egg-info/ -images: image2 image3 +images: image2 image3.4 image3.5 image3.6 image3.7 -image2: +image%: docker build \ - --tag $(PY2) \ + --tag $(IMAGE)$* \ --file Dockerfile \ --build-arg BASE_IMAGE=continuumio/miniconda:4.4.10 \ --build-arg NB_UID=$(NB_UID) \ --build-arg NB_GID=$(NB_GID) \ - --build-arg PY_VERSION=2 \ - . - -image3: - docker build \ - --tag $(PY3) \ - --file Dockerfile \ - --build-arg BASE_IMAGE=continuumio/miniconda3:4.4.10 \ - --build-arg NB_UID=$(NB_UID) \ - --build-arg NB_GID=$(NB_GID) \ - --build-arg PY_VERSION=3 \ + --build-arg PY_VERSION=$* \ . launch: @@ -43,22 +32,16 @@ launch: /rsconnect/run.sh $(TARGET) -notebook2: - make DOCKER_IMAGE=$(PY2) PY_VERSION=2 TARGET=run launch - -notebook3: - make DOCKER_IMAGE=$(PY3) PY_VERSION=3 TARGET=run launch +notebook%: + make DOCKER_IMAGE=$(IMAGE)$* PY_VERSION=$* TARGET=run launch test: # TODO run in container python -V python -Wi setup.py test -test2: - make DOCKER_IMAGE=$(PY2) PY_VERSION=2 TARGET=test launch - -test3: - make DOCKER_IMAGE=$(PY3) PY_VERSION=3 TARGET=test launch +test%: + make DOCKER_IMAGE=rstudio/rsconnect-jupyter-py$* PY_VERSION=$* TARGET=test launch dist: # wheels don't get built if _any_ file it tries to touch has a timestamp < 1980 @@ -66,7 +49,7 @@ dist: SOURCE_DATE_EPOCH="$(shell date +%s)"; python setup.py bdist_wheel package: - make DOCKER_IMAGE=$(PY3) PY_VERSION=3 TARGET=dist launch + make DOCKER_IMAGE=$(IMAGE)3 PY_VERSION=3 TARGET=dist launch run: # link python package @@ -83,17 +66,11 @@ run: shell: bash -shell2: - make DOCKER_IMAGE=$(PY2) PY_VERSION=2 TARGET=shell launch - -shell3: - make DOCKER_IMAGE=$(PY3) PY_VERSION=3 TARGET=shell launch - -dist-run2: - make DOCKER_IMAGE=$(PY2) PY_VERSION=2 TARGET=dist-run launch +shell%: + make DOCKER_IMAGE=$(IMAGE)$* PY_VERSION=$* TARGET=shell launch -dist-run3: - make DOCKER_IMAGE=$(PY3) PY_VERSION=3 TARGET=dist-run launch +dist-run%: + make DOCKER_IMAGE=$(IMAGE)$* PY_VERSION=$* TARGET=dist-run launch dist-run: dist pip install dist/rsconnect-1.0.0-py2.py3-none-any.whl