#!/bin/bash

set -eu

# Updates the tag for `runconduit/go-deps` across all Dockerfiles in this repository.

bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

sha=$(. $bindir/_tag.sh ; go_deps_sha)

for f in $( grep -lR --include=Dockerfile\* go-deps: $bindir/.. ) ; do
    sed -E -i.bak -e "s|runconduit/go-deps:[^ ]+|runconduit/go-deps:${sha}|" "$f"
    rm "$f".bak
done
