Release Management has been edited by Felix Meschberger (May 18, 2009).

Change summary:

add instructions for OBR

(View changes)

Content:

Release Management

This is a draft for a how to about releasing artifacts from Apache Sling. We are currently considering transferring to using Nexus instead of the traditional deployment via the Maven 2 mirros source on people.apache.org. This change may still take a while to implement. Until then the following instructions provide a guide post.

Most of the work is done by Maven.

Prerequisites

To prepare or perform a release you MUST BE at least a Apache Sling Committer

Each and every release must be signed; therefore the public key should be cross signed by other Apache committers (not required but suggested).
The public key should be added to http://www.apache.org/dist/incubator/sling/KEYS (See Appendix A)

When preparing the release on Mac OS X, check out Appendix E before trying the steps in the next chapter.

Building the Release Candidates

  • Make sure that an appropriate version for the release is entered in Jira
  • Build the release artifacts with Maven (the following instructions work on Unix systems, for Windows use a different path than /tmp)
    • mvn -Prelease -Darguments="-Prelease -DaltDeploymentRepository=local::default::file:///tmp" -DaltDeploymentRepository=local::default::file:///tmp  release:prepare
    • mvn -Prelease -Darguments="-Prelease -DaltDeploymentRepository=local::default::file:///tmp" -DaltDeploymentRepository=local::default::file:///tmp  release:perform
  • The above commands create a tag in svn, deploy the release candidates into your /tmp directory, sign the binaries and create the md5/sha1 files.
  • Beautify the checksums (see Appendix B)
  • Upload these files to people.apache.org into your home folder and put them there together with the KEYS file containing your public key so we can verify the signatures.
  • Start the vote thread, wait 72 hours.
  • If the vote fails (easy case first) remove the tag from svn - done
  • If the vote is successful, publish the release (see below)
  • Create a new version for the artifact in jira.



Publishing the Release

If the vote is successful:

  • copy the released artifacts to the dist directory on www.apache.org/dist/incubator/sling
  • delete the old release there (its archived)
  • deploy the release to the maven repository
  • Update the news section on the website
  • Update the download page on the website to point to the new release.
  • If you're releasing bundles, you can add it to the Sling Release OBR (see below the Appendix D).

For the last two tasks, it's better to give the mirrors some time to distribute the uploaded artifacts (one day should be fine). This ensures that once the website (news (TBD) and download page) is updated, people can actually download the artifacts.

Related Links

  1. http://www.apache.org/dev/release-signing.html
  2. http://wiki.apache.org/incubator/SigningReleases

Appendix A: Create and Add your key to http://www.apache.org/dist/incubator/sling/KEYS

Considering that you are using a *nix system with a working OpenSSH, GnuPG, and bash you can create and add your own key with the following command:

  1. Create a public/private pair key:
    gpg --gen-key

    When gpg asks for e-mail linked the key you MUST USE the <committer>@apache.org one
    When gpg asks for comment linked the key you SHOULD USE "CODE SIGNING KEY"

  2. Add the key to http://www.apache.org/dist/incubator/sling/KEYS: type the following command replacing the word e-mail with your Apache's one (<committer>@apache.org).
    (gpg --list-sigs e-mail && gpg --export --armor e-mail) > toadd.key
    scp toadd.key people.apache.org:
    ssh people.apache.org "cat toadd.key >> /x1/www/www.apache.org/dist/incubator/sling/KEYS"
  3. You are DONE, but to see the changes on http://www.apache.org/dist/incubator/sling/KEYS you must wait 2 hours

Appendix B: Beautifying the checksums

The checksum files generated by Maven are not directly usable with all tools. So the following scripts beautify these:

for f in *.md5 ; do g=`echo $f | sed "s/\.md5//"` ; echo "  $g" >> $f ;
done
   for f in *.sha1 ; do g=`echo $f | sed "s/\.sha1//"` ; echo "  $g" >> $f ;
done

Appendix C: Script to check releases

Felix Meschberger has developed a set of script aim at testing the file to release. You can find them here:
http://people.apache.org/~fmeschbe/release_helpers/

For those, using the Felix's script to create their releases, the last maven-release-plugin has changed. So, it doesn't work anymore. You have to add the

-DmavenExecutorId=forked-path
property to have the former behavior. If not, you won't be able to enter your GPG passphrase.

I'm sure there is others turn around, but at least this one works.

So, for mac users, it is something like:

mvn -Prelease -Darguments="-Prelease ${REPO}" ${REPO} -DmavenExecutorId=forked-path release:prepare -Dusername=yourId -Dpassword=yourPassword
svn up -r head
mvn release:prepare -Dresume
mvn -Prelease -Darguments="-Prelease ${REPO}" ${REPO} -DmavenExecutorId=forked-path release:perform

Appendix D: Deploy bundles on the Sling OBR

We are mainting an OSGi Bundle Repository providing all release of the Sling Bundles. This repository is maintained as part of the Apache Sling site and is available at http://incubator.apache.org/sling/obr/sling.xml. The source for this page is maintained in the SVN repository below the site, that is at http://svn.apache.org/repos/asf/incubator/sling/site/. To update the Sling OBR repository you must be an Apache Sling Committer since this requires SVN write access.

To update the OBR you may use the Apache Felix Maven Bundle Plugin which prepares the bundle descriptor to be added to the OBR file. Follow these steps to update the OBR:

1. Checkout or update the Site Source

$ svn checkout https://svn.apache.org/repos/asf/incubator/sling/site

Note, that you have to checkout the site using the https URL, otherwise you will not be able to commit the changes later.

2. Deploy the Descriptor

To deploy the project descriptor, checkout the tag of the bundle to deploy and run maven

$ svn checkout http://svn.apache.org/repos/asf/incubator/sling/tags/the_module_tag
$ mvn clean install \
    org.apache.felix:maven-bundle-plugin:deploy \
    -DprefixUrl=http://repo1.maven.org/maven2 \
    -DremoteOBR=sling.xml \
    -DaltDeploymentRepository=apache.releases::default::file:///path_to_site_checkout/obr

This generates the bundle descriptor and adds it to the sling.xml file of your site checkout.

2a. Variant: Refer to Maven Repository

Instead of checking out and building the project locally, you may also use the deploy-file goal of the Maven Bundle Plugin:

$ wget http://repo1.maven.org/maven2/org/apache/sling/the_module/version/the_module-version.jar
$ wget http://repo1.maven.org/maven2/org/apache/sling/the_module/version/the_module-version.pom
$ mvn org.apache.felix:maven-bundle-plugin:deploy-file \
    -Dfile=the_module-version.jar -DpomFile=the_module-version.pom \
    -DbundleUrl=http://repo1.maven.org/maven2/org/apache/sling/the_module/version/the_module-version.jar \
    -Durl=file:///path_to_site_checkout/obr \ 
    -DprefixUrl=http://repo1.maven.org/maven2 \
    -DremoteOBR=sling.xml
$ rm the_module-version.jar the_module-version.pom

3. Commite the Site Changes

In the Site checkout folder commit the changes to the obr/sling.xml files (you may also review the changes using the svn diff command).

$ svn commit -m"Add Bundle XYZ Version ABC" obr/sling.xml

4. Update the Site on people.apache.org

After committing the changes, you have to update the site source, which is getting mirrored to the web servers on people.apache.org

$ ssh people.apache.org svn update /x1/www/incubator.apache.org/sling/obr/sling.xml

After updating the site source it will generally take an hour or two until the changes are visible on the web.

Appendix E: Releasing on Mac OS X

When running the mvn release:prepare command, you might get the following error:

[INFO] Executing: svn --non-interactive commit --file /tmp/maven-scm-802409492.commit --targets /tmp/maven-scm-18804-targets
[INFO] Working directory: /homedir/dev/....
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The svn command failed.
Command output:
svn: Commit failed (details follow):
svn: MKACTIVITY of '/repos/asf/!svn/act/4f11ad5d-9161-0410-b4dd-cb727141ea8c': authorization failed (https://svn.apache.org)

There is a bug in svn on the Mac, as described by Brett Porter in his blog. He proposes to put a "svn" script at the head of your path to fix the issue. That solved the issue for me so I'm mentioning it here to save people the lookup.

Reply via email to