File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ VERSION=$1
7
7
VERSION_REGEX=' v([0-9]*)\.([0-9]*)\.([0-9]*)'
8
8
VERSION_REGEX_SED=' v\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)'
9
9
10
+ if [ ! -z " $( git status --porcelain) " ]; then
11
+ echo " working directory is dirty!"
12
+ exit 1
13
+ fi
14
+
10
15
if [ -z " $VERSION " ]; then
11
16
echo " No version specified, using 'git sv next-version'"
12
17
VERSION=v$( git sv next-version)
@@ -17,22 +22,34 @@ if [[ ! ($VERSION =~ $VERSION_REGEX) ]]; then
17
22
exit 1
18
23
fi
19
24
25
+ VERSION_NO_V=$( echo $VERSION | sed ' s/$v//g' )
26
+
20
27
echo VERSION=$VERSION
28
+ echo VERSION_NO_V=$VERSION_NO_V
21
29
22
30
cat docs/install.md | sed " s/ref=$VERSION_REGEX_SED /ref=$VERSION /g" > docs/install.md.tmp
23
31
mv docs/install.md.tmp docs/install.md
24
32
25
- cat config/manager/kustomization.yaml | sed " s/$VERSION_REGEX_SED /$VERSION /g" > config/manager/kustomization.yaml.tmp
26
- mv config/manager/kustomization.yaml.tmp config/manager/kustomization.yaml
33
+ SED_FILES=" \
34
+ docs/install.md \
35
+ "
36
+ ADD_FILES=" $SED_FILES "
37
+
38
+ yq -i " .version=\" $VERSION_NO_V \" | .appVersion=\" $VERSION \" " deploy/charts/template-controller/Chart.yaml
39
+ ADD_FILES=" $ADD_FILES deploy/charts/template-controller/Chart.yaml"
27
40
28
- FILES=" docs/install.md config/manager/kustomization.yaml"
41
+ for f in $SED_FILES ; do
42
+ echo " Replacing version in $f "
43
+ cat $f | sed " s/$VERSION_REGEX_SED /$VERSION /g" > $f .tmp
44
+ mv $f .tmp $f
45
+ done
29
46
30
- for f in $FILES ; do
47
+ for f in $ADD_FILES ; do
31
48
git add $f
32
49
done
33
50
34
51
echo " committing"
35
- git commit -o -m " build: Preparing release $VERSION " -- $FILES
52
+ git commit -o -m " build: Preparing release $VERSION " -- $ADD_FILES
36
53
37
54
echo " tagging"
38
55
git tag -f $VERSION
You can’t perform that action at this time.
0 commit comments