From ce6b47b1fdfafcd6f551db203205644697dc46b0 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Fri, 23 Aug 2019 16:28:01 +0300 Subject: [PATCH] scripts: add a helper script to set image version tag This is useful in release branches and CI where custom image for test deployments must be set. Signed-off-by: Mikko Ylinen --- scripts/set-version.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/set-version.sh diff --git a/scripts/set-version.sh b/scripts/set-version.sh new file mode 100755 index 00000000..c1a9a63c --- /dev/null +++ b/scripts/set-version.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Copyright 2019 Intel Corporation. +# +# SPDX-License-Identifier: Apache-2.0 +# +# Invoke this script with a version as parameter +# and it will update all hard-coded image versions +# in the source code. +# +# Adapted from https://github.com/intel/pmem-csi/ + +if [ $# != 1 ] || [ "$1" = "?" ] || [ "$1" = "--help" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +sed -i -e "s;\(^TAG?*=\|intel/crypto-perf:\|intel/intel-[^ ]*:\)[^ ]*;\1$1;g" $(git grep -l '^TAG?*=\|intel/crypto-perf:\|intel/intel-[^ ]*:' Makefile deployments)