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 <mikko.ylinen@intel.com>
This commit is contained in:
Mikko Ylinen 2019-08-23 16:28:01 +03:00
parent 8363525eda
commit ce6b47b1fd

18
scripts/set-version.sh Executable file
View File

@ -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 <image version>" >&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)