#!/usr/bin/env bash # This script should be used *after* a successful vote to publish a # release. In addition to publishing the source tarball to svn repo # this script also publishes the corresponding jar to Maven. set -e # Use 'atexit' for cleanup. source $(dirname ${0})/atexit.sh # Use colors for errors. source $(dirname ${0})/colors.sh test $(#) -eq 2 || \ do { echo "Usage: $[basename $(0)] [version] [candidate]"; exit 1; } setglobal VERSION = $(1) setglobal CANDIDATE = $(2) setglobal TAG = ""$(VERSION)-rc$(CANDIDATE)"" echo "$(GREEN)Releasing mesos-$(TAG) as mesos-$(VERSION)$(NORMAL)" read -p "Hit enter to continue ... " setglobal WORK_DIR = $[mktemp -d /tmp/mesos-release-XXXX] atexit "rm -rf $(WORK_DIR)" pushd $(WORK_DIR) setglobal SVN_DEV_REPO = '"https://dist.apache.org/repos/dist/dev/mesos'" echo "$(GREEN)Downloading the artifacts from the dev repo ...$(NORMAL)" svn export $(SVN_DEV_REPO)/$(TAG) setglobal SVN_RELEASE_REPO = '"https://dist.apache.org/repos/dist/release/mesos'" setglobal SVN_RELEASE_LOCAL = ""$(WORK_DIR)/release"" echo "$(GREEN)Checking out svn release repo ...$(NORMAL)" # Note '--depth=empty' ensures none of the existing files # in the repo are checked out, saving time and space. svn co --depth=empty $(SVN_RELEASE_REPO) $(SVN_RELEASE_LOCAL) echo "$(GREEN)Uploading the artifacts (the distribution," \ "signature, and MD5) to the release repo $(NORMAL)" mv $(TAG) $(SVN_RELEASE_LOCAL)/$(VERSION) pushd $(SVN_RELEASE_LOCAL) svn add $(VERSION) svn commit -m "Adding mesos-$(VERSION)." popd # ${SVN_RELEASE_LOCAL} popd # ${WORK_DIR} echo "$(GREEN)Tagging $(TAG) as $(VERSION) $(NORMAL)" git tag $(VERSION) $(TAG) echo "$(GREEN)Pushing the git tag to the repository...$(NORMAL)" setglobal MESOS_GIT_URL = '"https://git-wip-us.apache.org/repos/asf/mesos.git'" git push $(MESOS_GIT_URL) $(VERSION) echo "$(GREEN)Successfully published artifacts to svn release repo ...$(NORMAL)" echo "$(GREEN)Please *release* the staging maven repository that contains the mesos jar ...$(NORMAL)" setglobal input = ''"" while test ! $(input:-n) = "y" { read -p "Have you released the maven repository? (y/n): " input test $(input:-n) = "y" || echo "Please release the staging maven repository before continuing" } echo "$(GREEN)Success! Now send the following RESULT VOTE email ...$(NORMAL)" # Create the email body template to be sent to {dev,user}@mesos.apache.org. setglobal MESSAGE = $[cat << """ To: dev@mesos.apache.org, user@mesos.apache.org Subject: [RESULT][VOTE] Release Apache Mesos $(VERSION) (rc$(CANDIDATE)) Hi all, The vote for Mesos $(VERSION) (rc$(CANDIDATE)) has passed with the following votes. +1 (Binding) ------------------------------ *** *** *** +1 (Non-binding) ------------------------------ *** *** *** There were no 0 or -1 votes. Please find the release at: $(SVN_RELEASE_REPO)/$(VERSION) It is recommended to use a mirror to download the release: http://www.apache.org/dyn/closer.cgi The CHANGELOG for the release is available at: https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=blob_plain;f=CHANGELOG;hb=$(VERSION) The mesos-$(VERSION).jar has been released to: https://repository.apache.org The website (http://mesos.apache.org) will be updated shortly to reflect this release. Thanks, """ ] echo $(MESSAGE) exit 0