From 73d23109b14aaf2031b60cc06eec3573ae4920bc Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 10 Feb 2021 14:52:38 +0100 Subject: [PATCH] debian-stretch-titan: update deps on change After the initial clone of osmo-ttcn3-hacks and deps, let docker download deps/Makefile to invalidate the cache if the file changed. Run "git pull" and "make deps" afterwards, but only if the Makefile is different. The "if" saves time in the initial build of the image, it avoids the "git fetch" on every dependency repository during "make deps". Related: OS#5017 Change-Id: I56673312cfb23375d67900016aaac1931f677275 --- debian-stretch-titan/Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian-stretch-titan/Dockerfile b/debian-stretch-titan/Dockerfile index 0f4f17e2..39ff76f4 100644 --- a/debian-stretch-titan/Dockerfile +++ b/debian-stretch-titan/Dockerfile @@ -52,6 +52,12 @@ RUN DPKG_ARCH="$(dpkg --print-architecture)" && export $DPKG_ARCH && \ RUN git config --global user.email docker@dock.er && \ git config --global user.name "Dock Er" -# clone osmo-ttcn3-hacks and deps +# clone osmo-ttcn3-hacks and deps, invalidate cache if deps change (OS#5017) RUN git clone git://git.osmocom.org/osmo-ttcn3-hacks.git && \ make -C /osmo-ttcn3-hacks deps +ADD https://git.osmocom.org/osmo-ttcn3-hacks/plain/deps/Makefile /tmp/deps-Makefile +RUN if ! diff -q /tmp/deps-Makefile /osmo-ttcn3-hacks/deps/Makefile; then \ + cd /osmo-ttcn3-hacks && \ + git pull && \ + make deps; \ + fi