aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-21 17:48:47 -0800
committerGravatar MarkKoz <[email protected]>2020-02-21 22:35:13 -0800
commit034e9a062071affdec3ee9f54bbfddb04a2f4b5c (patch)
treeeb9c88036be51dfe2c4340dcd53e1698704d8590
parentCI: move lint & tests job into templates (diff)
CI: diff base against master only if venv changed
-rwxr-xr-xscripts/check_dockerfiles.sh30
1 files changed, 14 insertions, 16 deletions
diff --git a/scripts/check_dockerfiles.sh b/scripts/check_dockerfiles.sh
index 53842e2..b3b5fe2 100755
--- a/scripts/check_dockerfiles.sh
+++ b/scripts/check_dockerfiles.sh
@@ -78,21 +78,19 @@ else
echo \
"Changes detected in docker/venv.Dockerfile or the Pipfiles;" \
"the venv image will be built."
-fi
-# Though base image hasn't changed, it's still needed to build the venv.
-# Even if the venv hasn't changed, the dev venv image is still needed to run
-# the linter and tests. Therefore, the base image is also always needed.
-if master_commit="$(
- get_build "refs/heads/master" \
- | jq -re '.value[0].sourceVersion'
- )" \
- && git diff --quiet "${master_commit}" -- docker/base.Dockerfile
-then
- echo "Can pull base image from Docker Hub; no changes made since master."
- echo "##vso[task.setvariable variable=BASE_PULL;isOutput=true]True"
-else
- echo \
- "Cannot pull base image from Docker Hub due to detected changes;" \
- "the base image will be built."
+ # Though base image hasn't changed, it's still needed to build the venv.
+ if master_commit="$(
+ get_build "refs/heads/master" \
+ | jq -re '.value[0].sourceVersion'
+ )" \
+ && git diff --quiet "${master_commit}" -- docker/base.Dockerfile
+ then
+ echo "Can pull base image from Docker Hub; no changes since master."
+ echo "##vso[task.setvariable variable=BASE_PULL;isOutput=true]True"
+ else
+ echo \
+ "Cannot pull base image from Docker Hub due to detected changes;" \
+ "the base image will be built."
+ fi
fi