Merge pull request #198 from fnproject/bumpies

update bump script to be slightly less brittle, all perl syntax
This commit is contained in:
Reed Allman
2017-08-04 21:31:13 -07:00
committed by GitHub
3 changed files with 9 additions and 9 deletions

View File

@@ -15,12 +15,12 @@ fi
git pull git pull
version_file="version.go" version_file="version.go"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then if [ -z $(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file) ]; then
echo "did not find semantic version in $version_file" echo "did not find semantic version in $version_file"
exit 1 exit 1
fi fi
perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file perl -i -pe 's/(?<= = ")\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) version=$(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file)
echo "Version: $version" echo "Version: $version"
#cd lambda #cd lambda

View File

@@ -18,12 +18,12 @@ fi
git pull git pull
version_file="main.go" version_file="main.go"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then if [ -z $(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file) ]; then
echo "did not find semantic version in $version_file" echo "did not find semantic version in $version_file"
exit 1 exit 1
fi fi
perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file perl -i -pe 's/(?<= = ")\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) version=$(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file)
echo "Version: $version" echo "Version: $version"
make docker-build make docker-build

View File

@@ -18,12 +18,12 @@ fi
git pull git pull
version_file="api/version/version.go" version_file="api/version/version.go"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then if [ -z $(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file) ]; then
echo "did not find semantic version in $version_file" echo "did not find semantic version in $version_file"
exit 1 exit 1
fi fi
perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file perl -i -pe 's/(?<= = ")\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) version=$(grep -m1 -Po '(?<= = ")\d+\.\d+\.\d+' $version_file)
echo "Version: $version" echo "Version: $version"
make docker-build make docker-build