Skip to content

Conversation

@tzulitai
Copy link
Contributor

@tzulitai tzulitai commented Feb 6, 2020

This adds utility scripts for the following functionality:

  • Create a new release branch
  • Update POM versions in current branch, and creates a commit
  • Create a source release package
  • Deploying Maven artifacts to Apache staging area

This scripts are adopted from apache/flink with modifications to suit Stateful Functions.


Example usage:

  • Create a new version branch:
$flink-statefun: RELEASE_VERSION=1.2.3 RELEASE_CANDIDATE=2 ./tools/releasing/create_release_branch.sh

This checkouts a new branch (with no additional changes) named release-1.2.3

  • Update POM versions in current branch:
$flink-statefun: OLD_VERSION=1.2-SNAPSHOT NEW_VERSION=1.2.3 ./tools/releasing/update_branch_version.sh

This updates all POM files, and creates a commit for the changes.

  • Create a source release package:
$flink-statefun: RELEASE_VERSION=1.2.3 ./tools/releasing/create_source_release.sh

This creates a release directory in the project root, containing the source tarball flink-statefun-1.2.3-src.tgz and signatures.

  • Deploy Maven artifacts to Apache staging area:
$flink-statefun: ./tools/releasing/deploy_staging_jars.sh

This builds the project and deploys artifacts to be staged at repository.apache.org.

This adds utility scripts for the following functionality:
* Create a new release branch
* Update POM versions in current branch, and creates a commit
* Create a source release package
* Deploying Maven artifacts to Apache staging area
Copy link
Contributor

@igalshilman igalshilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, and brining statefun one step closer to a releasable Apache project.
I have left some comments to make the script a bit more robust, but the general looks of it seems great.

##
## Required variables
##
RELEASE_VERSION=${RELEASE_VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like a redundant assignment, am I missing some bash-foo :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igalshilman its there to avoid Unresolved variable warnings later in the script when using the variable.


TAG_COMMIT_MSG="Apache Flink Stateful Functions, release ${RELEASE_VERSION}"
if [ "${RELEASE_CANDIDATE}" != "none" ]; then
TAG_COMMIT_MSG="${TAG_COMMIT_MSG} candidate #${RELEASE_CANDIDATE}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TAG_COMMIT_MESSAGE is unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, good catch.


###########################

cd ${PROJECT_ROOT}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good practice to test for a file that you would expect to see here, for example pom.xml, or README.md.
This would help if the shell script would be moved outside it’s current location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

cd ${PROJECT_ROOT}

#change version in all pom files
find . -name 'pom.xml' -type f -exec perl -pi -e 's#<version>(.*)'${OLD_VERSION}'(.*)</version>#<version>${1}'${NEW_VERSION}'${2}</version>#' {} \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@tzulitai tzulitai Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll still keep this script and encourage its usage, since this script handles doc version string updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, there is a version string in the README as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change the Maven POM update part to mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${NEW_VERSION}.

@tzulitai
Copy link
Contributor Author

tzulitai commented Feb 7, 2020

Thanks for the review @igalshilman! I've addressed the comments.
Will wait for another Travis run before merging this.

@tzulitai tzulitai closed this in 7af70a0 Feb 7, 2020
morsapaes pushed a commit to morsapaes/flink-statefun that referenced this pull request Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants