-
Notifications
You must be signed in to change notification settings - Fork 0
/
bump_autoscaler
executable file
·37 lines (30 loc) · 994 Bytes
/
bump_autoscaler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# Bump the docker version number of the autoscaler
if [ "$DWX_HOME" = "" ]
then
echo "Need to be in dwx env"
exit 1
fi
DEPLOY=$DWX_HOME/charts/impala-autoscaler/templates/impala-autoscaler-deployment.yaml
MAKEFILE=$DWX_HOME/operator/Makefile
NUM=$(grep 'IMPALA_AUTOSCALER_DEV_IMAGE ?= bartash/impala-autoscaler' $MAKEFILE | awk -F: '{print $2}')
if [ -z "$NUM" ]
then
echo could not find version number
exit 1
fi
if [ "$NUM" -ne "$NUM" ] 2>/dev/null
then
echo "$NUM is not an integer !!"
exit 1
fi
NEW_NUM=$((NUM + 1))
echo "bump version from $NUM to $NEW_NUM"
NEWMAKEFILE=/tmp/newdmake$$
sed "s?bartash/impala-autoscaler:$NUM?bartash/impala-autoscaler:$NEW_NUM?" < $MAKEFILE > $NEWMAKEFILE
cp $NEWMAKEFILE $MAKEFILE
NEWDEPLOY=/tmp/newdep$$
sed "s?bartash/impala-autoscaler:$NUM?bartash/impala-autoscaler:$NEW_NUM?" < $DEPLOY > $NEWDEPLOY
cp $NEWDEPLOY $DEPLOY
git commit -a -m "DO NOT PUSH: use bartash/impala-autoscaler:$NEW_NUM"
git show -1