Skip to content

Commit

Permalink
Use ehrql rather than databuilder as canonical image name
Browse files Browse the repository at this point in the history
And prevent attempts to update `databuilder` directly. Previously
updating `databuilder` would update the `ehrql` version, but not vice
versa so it was possible for them to get out of sync.
  • Loading branch information
evansd committed Aug 9, 2023
1 parent 54a3617 commit 8a6eb1f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/update-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ if test "${1:-}" == ""; then
echo "usage: $0 image[:tag]"
exit 1
fi
if [[ $1 == databuilder* ]]; then
echo "'databuilder' is deprecated as an image name, use 'ehrql' instead."
echo "Note that updating ehrql will automatically update the databuilder image."
exit 1
fi
set -x

docker pull docker-proxy.opensafely.org/opensafely-core/$1
docker tag docker-proxy.opensafely.org/opensafely-core/$1 ghcr.io/opensafely-core/$1
# temp b/w compat tag
docker tag docker-proxy.opensafely.org/opensafely-core/$1 ghcr.io/opensafely/$1

# If the image being updated is databuilder, make sure we get the aliased ehrql tag too
if [[ $1 == databuilder* ]]; then
image=$(echo "$1" | sed -r 's/[databuilder]+/ehrql/g')
echo "Updating ehrql image: $image"
# If the image being updated is ehrql, make sure we get the aliased databuilder tag too
if [[ $1 == ehrql* ]]; then
image=$(echo "$1" | sed -r 's/[ehrql]+/databuilder/g')
echo "Updating databuilder image: $image"
docker pull docker-proxy.opensafely.org/opensafely-core/$image
docker tag docker-proxy.opensafely.org/opensafely-core/$image ghcr.io/opensafely-core/$image
fi
Expand Down

0 comments on commit 8a6eb1f

Please sign in to comment.