From 7bd5288559e72401e7a2ccada5b3cfb2c3c075c0 Mon Sep 17 00:00:00 2001 From: Vahid Date: Wed, 15 May 2019 12:33:58 -0700 Subject: [PATCH] Assign image tag based on the pulsar wheel version It can help find a docker image if its tag is set appropriately, e.g., using the version of pulsar wheel used for creating the image. On my mac I am not able to leverage `BASH_REMATCH[1]` to extract version number from the wheel filename, since it seems macOS has a different function that overrides the value of this variable: https://stackoverflow.com/a/40457982 --- docker/coexecutor/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/coexecutor/Makefile b/docker/coexecutor/Makefile index ab4ce34c..ee131111 100644 --- a/docker/coexecutor/Makefile +++ b/docker/coexecutor/Makefile @@ -4,4 +4,7 @@ docker-image: cd ../..; make dist; cp dist/pulsar*whl docker/coexecutor all: docker-image + re='pulsar_app-([0-9]+.[0-9]+.[0-9]+).dev0-py2.py3-none-any.whl' + f='$(shell ls -1a | egrep '$(re)')' + version=$(shell if [[ $(f) =~ $(re) ]]; then echo "v${BASH_REMATCH[1]}"; else echo "unknown_version"; fi) docker build -t 'galaxy/pulsar-pod-staging:0.1' .