Skip to content

Commit b347817

Browse files
committed
Add util script to bump cookbook version
Signed-off-by: Francesco De Martino <[email protected]>
1 parent abd914d commit b347817

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

util/bump-version.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [ -z "$1" ]; then
6+
echo "New version not specified. Usage: bump-version.sh NEW_VERSION"
7+
exit 1
8+
fi
9+
10+
NEW_VERSION=$1
11+
CURRENT_VERSION=$(sed -ne "s/^version '\(.*\)'/\1/p" metadata.rb)
12+
13+
sed -i -e "s/\(.*parallelcluster.*version.*\)$CURRENT_VERSION\(.*\)/\1$NEW_VERSION\2/g" amis/packer_variables.json
14+
sed -i "s/default\['cfncluster'\]\['cfncluster-version'\] = '$CURRENT_VERSION'/default['cfncluster']['cfncluster-version'] = '$NEW_VERSION'/g" attributes/default.rb
15+
sed -i "s/default\['cfncluster'\]\['cfncluster-node-version'\] = '$CURRENT_VERSION'/default['cfncluster']['cfncluster-node-version'] = '$NEW_VERSION'/g" attributes/default.rb
16+
sed -i "s/version '$CURRENT_VERSION'/version '$NEW_VERSION'/g" metadata.rb

0 commit comments

Comments
 (0)