forked from nais/naisd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bump.sh
26 lines (19 loc) · 730 Bytes
/
bump.sh
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
#!/bin/bash
# bump version number by one
# uses first arg as token for github push, else use local default
TOKEN=${1}
CHART="./helm/naisd/Chart.yaml"
HELM_VALUES="./helm/naisd/values.yaml"
OLD=$(cat ./version | cut -d'.' -f1)
NEW=$(expr $OLD + 1).0.0
echo "$NEW" > version
grep -v "version: " $CHART > temp && mv temp $CHART && rm -f temp && echo "version: $NEW" >> $CHART
grep -v "version: " $HELM_VALUES > temp && mv temp $HELM_VALUES && rm -f temp && echo "version: $NEW" >> $HELM_VALUES
git add version $CHART $HELM_VALUES
git commit -am "increased version number to $NEW [skip ci]"
if [[ -n ${TOKEN} ]]; then
git push https://${TOKEN}@github.com/nais/naisd HEAD:master
else
git push origin master
fi
echo $NEW