|
|
|
|
@ -2,6 +2,15 @@ |
|
|
|
|
|
|
|
|
|
set -euo pipefail |
|
|
|
|
|
|
|
|
|
# The BSD version of the sed command in MacOS doesn't work with this script. |
|
|
|
|
# Please install gnu-sed via `brew install gnu-sed`. |
|
|
|
|
# The gsed command becomes available then. |
|
|
|
|
SED="sed" |
|
|
|
|
if command -v gsed &> /dev/null ; then |
|
|
|
|
echo "Using gsed" |
|
|
|
|
SED="gsed" |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
VERSION="${1-}" |
|
|
|
|
if [[ -z "${VERSION}" ]]; then |
|
|
|
|
>&2 echo "Usage: $0 <version>" |
|
|
|
|
@ -10,8 +19,8 @@ fi |
|
|
|
|
|
|
|
|
|
echo "Updating loki-build-image references to '${VERSION}'" |
|
|
|
|
|
|
|
|
|
find . -type f \( -name '*.yml' -o -name '*.yaml' -o -name '*Dockerfile*' \) -exec grep -lP "grafana/loki-build-image:[0-9]+" {} \; | grep -ve '.drone' | |
|
|
|
|
find . -type f \( -name '*.yml' -o -name '*.yaml' -o -name '*Dockerfile*' \) -exec grep -lE "grafana/loki-build-image:[0-9]+" {} \; | grep -ve '.drone' | |
|
|
|
|
while read -r x; do |
|
|
|
|
echo "Updating ${x}" |
|
|
|
|
sed -i -re "s,grafana/loki-build-image:[0-9]+\.[0-9]+\.[0-9]+,grafana/loki-build-image:${VERSION},g" "${x}" |
|
|
|
|
done |
|
|
|
|
${SED} -i -re "s,grafana/loki-build-image:[0-9]+\.[0-9]+\.[0-9]+,grafana/loki-build-image:${VERSION},g" "${x}" |
|
|
|
|
done |
|
|
|
|
|