This needs substantial updating in light of the Apache move.
Brooklyn is published to two locations:
Brooklyn artifacts are generally downloaded from:
To publish:
Your .m2/settings.xml must be configured with the right credentials for Sonatype
<servers> ... <server> <username> ... </username> <password> ... </password> <id>sonatype-nexus-snapshots</id> </server> <server> <username> ... </username> <password> ... </password> <id>sonatype-nexus-staging</id> </server> ... </servers>
You must be configured to sign artifacts using PGP.
If this is the first time you have used Sonatype, the Sonatype - Maven Usage Guide is required reading.
The code snippets below use the following variables: {% highlight bash %}
export BROOKLYN_DIR=/path/to/brooklyncentral-brooklyn export EXAMPLES_DIR=/path/to/brooklyncentral-brooklyn-examples export SITE_DIR=/path/to/brooklyncentral-brooklyncentral.github.com
export SNAPSHOT_VERSION=0.6.0-SNAPSHOT export RELEASE_VERSION=0.6.0-M1 {% endhighlight %}
Execute the following: {% highlight bash %} mvn -Dbrooklyn.deployTo=sonatype -DskipTests clean install deploy {% endhighlight %}
(Only required if there have been significant changes to docs or java docs.)
{% highlight bash %}
cd $BROOKLYN_DIR/docs git checkout master
if [ ! -f $SITE_DIR/index.html ] ; then echo “could not find docs in $SITE_DIR” ; exit 1 ; fi
_scripts/build.sh || { echo “failed to build docs” ; exit 1 ; }
rm -rf $SITE_DIR/v/$SNAPSHOT_VERSION mkdir $SITE_DIR/v/$SNAPSHOT_VERSION cp -r _site/* $SITE_DIR/v/$SNAPSHOT_VERSION/
pushd $SITE_DIR git add -A . git commit -m “Updated version docs for version $SNAPSHOT_VERSION” git push popd
{% endhighlight %}
{% highlight bash %}
cd $BROOKLYN_DIR git checkout -b $RELEASE_VERSION usage/scripts/change-version.sh $SNAPSHOT_VERSION $RELEASE_VERSION git commit -a -m “Changed version to $RELEASE_VERSION” git push -u upstream $RELEASE_VERSION
{% endhighlight %}
{% highlight bash %} mvn -Dbrooklyn.deployTo=sonatype -DskipTests clean install deploy {% endhighlight %}
{% highlight bash %}
cd $EXAMPLES_DIR
pushd $BROOKLYN_DIR git checkout $RELEASE_VERSION popd
if [ ! -d simple-web-cluster ] ; then echo “wrong dir” ; exit 1 ; fi git checkout master git checkout -b $RELEASE_VERSION rm -rf * cp -r $BROOKLYN_DIR/examples/* . rm -rf target git add -A git commit -m “branch for $RELEASE_VERSION” git push -u origin $RELEASE_VERSION
{% endhighlight %}
{% highlight bash %}
cd $BROOKLYN_DIR/docs git checkout $RELEASE_VERSION
if [ ! -f $SITE_DIR/index.html ] ; then echo “could not find docs in $SITE_DIR” ; exit 1 ; fi
_scripts/build.sh || { echo “failed to build docs” ; exit 1 ; }
rm -rf $SITE_DIR/v/$RELEASE_VERSION mkdir $SITE_DIR/v/$RELEASE_VERSION cp -r _site/* $SITE_DIR/v/$RELEASE_VERSION/
pushd $SITE_DIR git add -A . git commit -m “Updated version docs for version $RELEASE_VERSION” git push popd
{% endhighlight %}
Complete all above steps.
{% highlight bash %}
cd $EXAMPLES_DIR
pushd $BROOKLYN_DIR git checkout $RELEASE_VERSION popd
if [ ! -d simple-web-cluster ] ; then echo “wrong dir” ; exit 1 ; fi git checkout master rm -rf * cp -r $BROOKLYN_DIR/examples/* . rm -rf target git add -A git commit -m “Updated to $RELEASE_VERSION” git push -u origin master
{% endhighlight %}
{% highlight bash %}
cd $BROOKLYN_DIR/docs
pushd $SITE_DIR
if [ -f start/index.html ] ; then for x in * ; do if [[ $x != “v” ]] ; then rm -rf $x ; fi ; done else echo IN WRONG DIRECTORY $SITE_DIR - export SITE_DIR to continue exit 1 fi popd
_scripts/build.sh --url "" || { echo “failed to build docs” ; exit 1 ; }
cp -r _site/* $SITE_DIR/
pushd $SITE_DIR git add -A . git commit -m “Updated root docs for version $RELEASE_VERSION” git push popd
{% endhighlight %}
{% highlight bash %}
export NEW_SNAPSHOT_VERSION=0.7.0-SNAPSHOT
cd $BROOKLYN_DIR git checkout master usage/scripts/change-version.sh $SNAPSHOT_VERSION $NEW_SNAPSHOT_VERSION git commit -a -m “Changed version to $NEW_SNAPSHOT_VERSION” git push -u upstream master
{% endhighlight %}