Skip to content

Commit

Permalink
[release][scripts] use perl instead of sed for portability
Browse files Browse the repository at this point in the history
  • Loading branch information
mxm committed Oct 28, 2015
1 parent 4687932 commit edd1914
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
4 changes: 2 additions & 2 deletions tools/change-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [[ "$HERE" != "tools" ]]; then
fi

# change version in all pom files
find .. -name 'pom.xml' -type f -exec sed -i 's#<version>'"$OLD"'</version>#<version>'"$NEW"'</version>#' {} \;
find .. -name 'pom.xml' -type f -exec perl -pi -e 's#<version>'"$OLD"'</version>#<version>'"$NEW"'</version>#' {} \;

# change version of the quickstart property
find .. -name 'pom.xml' -type f -exec sed -i 's#<flink.version>'"$OLD"'</flink.version>#<flink.version>'"$NEW"'</flink.version>#' {} \;
find .. -name 'pom.xml' -type f -exec perl -pi -e 's#<flink.version>'"$OLD"'</flink.version>#<flink.version>'"$NEW"'</flink.version>#' {} \;
24 changes: 5 additions & 19 deletions tools/create_release_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,16 @@ make_source_release() {
cd flink

#change version in all pom files
if [ "$(uname)" == "Darwin" ]; then
find . -name 'pom.xml' -type f -exec sed -i "" 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
else
find . -name 'pom.xml' -type f -exec sed -i 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
fi
find . -name 'pom.xml' -type f -exec perl -pi -e 's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;

#change version in quickstart archetypes
if [ "$(uname)" == "Darwin" ]; then
find . -name 'pom.xml' -type f -exec sed -i "" 's#<flink.version>'$OLD_VERSION'</flink.version>#<flink.version>'$NEW_VERSION'</flink.version>#' {} \;
else
find . -name 'pom.xml' -type f -exec sed -i 's#<flink.version>'$OLD_VERSION'</flink.version>#<flink.version>'$NEW_VERSION'</flink.version>#' {} \;
fi
find . -name 'pom.xml' -type f -exec perl -pi -e 's#<flink.version>'$OLD_VERSION'</flink.version>#<flink.version>'$NEW_VERSION'</flink.version>#' {} \;

#change version of documentation
cd docs
if [ "$(uname)" == "Darwin" ]; then
sed -i "" "s#version: .*#version: ${NEW_VERSION}#" _config.yml
sed -i "" "s#version_hadoop1: .*#version_hadoop1: ${NEW_VERSION}-hadoop1#" _config.yml
sed -i "" "s#version_short: .*#version_short: ${NEW_VERSION}#" _config.yml
else
sed -i "s#version: .*#version: ${NEW_VERSION}#" _config.yml
sed -i "s#version_hadoop1: .*#version_hadoop1: ${NEW_VERSION}-hadoop1#" _config.yml
sed -i "s#version_short: .*#version_short: ${NEW_VERSION}#" _config.yml
fi
perl -pi -e "s#^version: .*#version: ${NEW_VERSION}#" _config.yml
perl -pi -e "s#^version_hadoop1: .*#version_hadoop1: ${NEW_VERSION}-hadoop1#" _config.yml
perl -pi -e "s#^version_short: .*#version_short: ${NEW_VERSION}#" _config.yml
cd ..

git commit --author="$GIT_AUTHOR" -am "Commit for release $RELEASE_VERSION"
Expand Down

0 comments on commit edd1914

Please sign in to comment.