Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
288 lines (260 sloc) 13.3 KB
<!--
JBoss, Home of Professional Open Source
Copyright 2009, Red Hat Middleware LLC, and individual contributors
as indicated by the @author tags.
See the copyright.txt in the distribution for a
full listing of individual contributors.
This copyrighted material is made available to anyone wishing to use,
modify, copy, or redistribute it subject to the terms and conditions
of the GNU Lesser General Public License, v. 2.1.
This program is distributed in the hope that it will be useful, but WITHOUT A
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License,
v.2.1 along with this distribution; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
(C) 2007-2009,
@author JBoss Inc. (jonathan.halliday@redhat.com)
-->
<!--
build-release-pkgs.xml: Utility script for building Narayana release artifacts.
Probably only useful for Narayana dev team. Everyone else should only need the
regular build.xml.
This script automates the some steps of the release build and packaging process
to reduce the opportunities for users to get it wrong. For example, it works from
a fresh git checkout to ensure locally modified files in a dev's git working copy
don't sneak into the release bundle.
usage:
Tag the Narayana release on GitHub.
or you can do a snapshot release direct from master, see properties below.
Check the version of WildFly referenced in pom.xml is sane.
In general, use the oldest WildFly release the Narayana release is intended to support.
Update the properties section below to suit your machine.
Set JAVA_HOME to a jdk 1.6, since that's the version we currently support.
ant -f build-release-pkgs.xml all
rsync or sftp the downloads to publish to the web site (careful with the trailing '/') e.g.
rsync \-\-protocol=29 -avz 4.11.0.Final jbosstm@filemgmt.jboss.org:downloads_htdocs/jbosstm/
Check out Narayana web page. This script uploas all the contents to the develop branch.
However, you have to execute awestruct build as explained in web page's readme.
Update appropriate wiki pages, such as the 'which version to use' page.
http://community.jboss.org/wiki/JBossTransactionsVersionGuide
Then login to https://repository.jboss.org/nexus/ and publish the artifacts.
This version is for Narayana 5.0.4 onwards. Don't use it for earlier releases, they are structured differently.
-->
<project name="Narayana Release Packaging" default="fail" basedir=".">
<description>
package Narayana binary + src files for upload to website and other repos.
</description>
<property name="mvn.executable" value="tools/maven/bin/mvn.bat"/>
<property name="awestruct.executable" value="awestruct.bat"/>
<!-- where to get the source -->
<property name="gitbase" value="git@github.com:jbosstm"/>
<!-- The tag as it appears under svnbase -->
<property name="tag" value="5.3.4.Final-SNAPSHOT"/>
<!-- a working directory for the process. Can contain output from previous releases if you like to keep them archived locally. -->
<property name="workdir" location="${user.home}/tmp/narayana/${tag}"/>
<!-- the location the Narayana web site downloads are copied to -->
<property name="downloads.dir" value="downloads_htdocs/jbosstm/"/>
<!-- the location the Narayana web site downloads are copied to -->
<property name="docs.dir" value="docs_htdocs/jbosstm/"/>
<!-- you probably don't need to change anything below here -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="./antbuildsystem/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<target name="fail">
<fail message="you must specify a target"/>
</target>
<target name="all" depends="dist,downloads,docs,web"/>
<target name="dist-init" unless="dist-init">
<tstamp/>
<fail message="You must set a workdir">
<condition>
<not>
<isset property="workdir"/>
</not>
</condition>
</fail>
<fail message="You cannot perform a build without a clone in ${workdir}/sources/narayana/">
<condition>
<not>
<available file="${workdir}/sources/narayana/" type="dir"/>
</not>
</condition>
</fail>
<!-- pull the source code from git -->
<exec executable="git" dir="${workdir}/sources/narayana/">
<arg value="checkout"/>
<arg value="${tag}"/>
</exec>
</target>
<target name="dist" depends="dist-init" description="build the end-user release bundles (src and binary)">
<!-- Clean all generated artefacts -->
<exec dir="${workdir}/sources/narayana/" executable="${mvn.executable}" failonerror="true">
<arg line="clean -gs tools/maven/conf/settings.xml -Dorson.jar.location=${user.dir}/ext/"/>
</exec>
<!-- package the full source release (all src tree) -->
<delete file="${workdir}/narayana-full-${tag}-src.zip"/>
<zip basedir="${workdir}/sources/narayana/" destfile="${workdir}/narayana-full-${tag}-src.zip" includes="**"/>
<!-- build the binary releases -->
<exec dir="${workdir}/sources/narayana/" executable="${mvn.executable}" failonerror="true">
<arg line="clean deploy -DskipTests -gs tools/maven/conf/settings.xml -Dorson.jar.location=${user.dir}/ext/ -Prelease"/>
</exec>
<exec dir="${workdir}/sources/narayana/" executable="${mvn.executable}" failonerror="true">
<arg line="clean deploy -DskipTests -gs tools/maven/conf/settings.xml -Prelease -f blacktie/utils/cpp-plugin/pom.xml"/>
</exec>
<exec dir="${workdir}/sources/narayana/" executable="${mvn.executable}" failonerror="true">
<arg line="clean deploy -DskipTests -gs tools/maven/conf/settings.xml -Prelease -f blacktie/pom.xml -pl :blacktie-jatmibroker-nbf -am"/>
</exec>
</target>
<!-- copy the release into the downloads dir tree (http://www.jboss.org/jbosstm web site content) -->
<target name="docs">
<exec executable="git" dir="${workdir}/sources/documentation/">
<arg value="checkout"/>
<arg value="${tag}"/>
</exec>
<exec dir="${workdir}/sources/documentation/" executable="${mvn.executable}" failonerror="true">
<arg line="install -Prelease"/>
</exec>
</target>
<target name="downloads" description="copy release bundles to Narayana web site storage">
<delete dir="${workdir}/downloads/"/>
<mkdir dir="${workdir}/downloads/"/>
<mkdir dir="${workdir}/downloads/src"/>
<mkdir dir="${workdir}/downloads/binary"/>
<mkdir dir="${workdir}/downloads/idl"/>
<copy todir="${workdir}/downloads/src">
<fileset dir="${workdir}" includes="narayana-*-${tag}-src.zip"/>
</copy>
<copy todir="${workdir}/downloads/binary">
<fileset dir="${workdir}/sources/narayana/narayana-full/target/" includes="narayana-full-${tag}-bin.zip"/>
</copy>
<copy todir="${workdir}/downloads/idl">
<fileset dir="${workdir}/sources/narayana/ArjunaJTS/idl/src/main/idl/arjuna">
<include name="ArjunaOTS.idl"/>
</fileset>
</copy>
<copy todir="${workdir}/downloads/idl">
<fileset dir="${workdir}/sources/narayana/ArjunaJTS/idl/src/main/idl/omg">
<include name="CosTransactions.idl"/>
<include name="XA.idl"/>
</fileset>
</copy>
<copy file="${workdir}/sources/narayana/narayana-full/target/narayana-full-${tag}-javadoc.jar" todir="${workdir}/downloads/api"/>
<copy file="${workdir}/sources/narayana/blacktie/jatmibroker-xatmi/target/blacktie-jatmibroker-xatmi-${tag}-javadoc.jar" todir="${workdir}/downloads/jatmibroker-xatmi-api"/>
<copy file="${workdir}/sources/narayana/blacktie/jatmibroker-nbf/target/blacktie-jatmibroker-nbf-${tag}-javadoc.jar" todir="${workdir}/downloads/jatmibroker-nbf-api"/>
<exec executable="bash" dir="${workdir}" failonerror="true">
<arg value="-c"/>
<arg value="rsync --chmod=ugo=rwX --protocol=29 --partial --progress --rsh=ssh -r downloads/* jbosstm@filemgmt.jboss.org:${downloads.dir}/${tag}" />
</exec>
</target>
<target name="web" description="Update downloads, docs, and javadocs on Narayana web page and commit them">
<!-- Check out web page development branch -->
<delete dir="${workdir}/narayana.io"/>
<exec executable="git" dir="${workdir}">
<arg value="clone"/>
<arg value="${gitbase}/narayana.io.git"/>
</exec>
<exec executable="git" dir="${workdir}/narayana.io">
<arg value="checkout"/>
<arg value="develop"/>
</exec>
<!-- Update web page content -->
<antcall target="web-downloads">
<param name="config-dir" value="${workdir}/narayana.io/_config/"/>
</antcall>
<antcall target="web-docs">
<param name="docs-dir" value="${workdir}/narayana.io/docs/"/>
</antcall>
<antcall target="web-api">
<param name="docs-dir" value="${workdir}/narayana.io/docs/"/>
<param name="config-dir" value="${workdir}/narayana.io/_config/"/>
</antcall>
<!-- Commit web page changes -->
<exec executable="git" dir="${workdir}/narayana.io/">
<arg value="add"/>
<arg value="--all"/>
</exec>
<exec executable="git" dir="${workdir}/narayana.io/">
<arg value="commit"/>
<arg value="-m"/>
<arg value="Updated Narayana to ${tag}"/>
</exec>
<exec executable="git" dir="${workdir}/narayana.io/">
<arg value="push"/>
<arg value="origin"/>
<arg value="develop"/>
</exec>
<!-- Build web page and push to jboss.org -->
<exec executable="${awestruct.executable}" dir="${workdir}/narayana.io/">
<arg value="-P"/>
<arg value="production"/>
</exec>
<exec executable="bash" dir="${workdir}/narayana.io/" failonerror="true">
<arg value="-c"/>
<arg value="rsync --protocol=29 --partial --progress --rsh=ssh --delete-after -r _site/* jbosstm@filemgmt.jboss.org:www_htdocs/jbosstm/" />
</exec>
</target>
<target name="web-docs" depends="docs.check" if="docs.exist" description="Update documentations on Narayana web page">
<delete dir="${docs-dir}product"/>
<delete dir="${docs-dir}project"/>
<mkdir dir="${docs-dir}product"/>
<mkdir dir="${docs-dir}project"/>
<copy todir="${docs-dir}product">
<fileset dir="${workdir}/sources/documentation/product/target/docbook/publish/en-US/html_single"/>
</copy>
<copy todir="${docs-dir}project">
<fileset dir="${workdir}/sources/documentation/project/target/docbook/publish/en-US/html_single"/>
</copy>
</target>
<target name="web-downloads" depends="downloads.check" if="downloads.exist" description="Update downloads on Narayana web page">
<tstamp>
<format property="date" pattern="yyyy-MM-dd"/>
</tstamp>
<!-- Create new current Narayana release configuration -->
<delete dir="${config-dir}current_narayana_release.yml"/>
<touch file="${config-dir}current_narayana_release.yml"/>
<echo file="${config-dir}current_narayana_release.yml">version: ${tag}
date: ${date}
binary: http://www.jboss.org/jbosstm/downloads/${tag}/binary/narayana-full-${tag}-bin.zip
source: http://www.jboss.org/jbosstm/downloads/${tag}/src/narayana-full-${tag}-src.zip
blacktie:
windows: http://www.jboss.org/jbosstm/downloads/${tag}/binary/blacktie-${tag}-vc9x32-bin.zip
linux: http://www.jboss.org/jbosstm/downloads/${tag}/binary/blacktie-${tag}-centos54x64-bin.tar.gz</echo>
</target>
<target name="web-api" depends="api.check" if="api.exist" description="Update javadocs on Narayana web page">
<!-- Update javadoc htmls on the page -->
<delete dir="${docs-dir}/api/"/>
<delete dir="${docs-dir}/jatmibroker-xatmi-api/"/>
<delete dir="${docs-dir}/jatmibroker-nbf-api/"/>
<unzip src="${workdir}/sources/narayana/narayana-full/target/narayana-full-${tag}-javadoc.jar" dest="${docs-dir}/api"/>
<unzip src="${workdir}/sources/narayana/blacktie/jatmibroker-xatmi/target/blacktie-jatmibroker-xatmi-${tag}-javadoc.jar" dest="${docs-dir}/jatmibroker-xatmi-api"/>
<unzip src="${workdir}/sources/narayana/blacktie/jatmibroker-nbf/target/blacktie-jatmibroker-nbf-${tag}-javadoc.jar" dest="${docs-dir}/jatmibroker-nbf-api"/>
<!-- Update javadocs download url -->
<exec executable="sed" dir="${config-dir}" outputproperty="first-api-line">
<arg value="q"/>
<arg value="current_narayana_api.yml"/>
</exec>
<echo file="${config-dir}current_narayana_api.yml">${first-api-line}
viewblacktie: /docs/jatmibroker-xatmi-api/index.html
viewblacktienbf: /docs/jatmibroker-nbf-api/index.html
download: http://www.jboss.org/jbosstm/downloads/${tag}/api/narayana-full-${tag}-javadoc.jar</echo>
</target>
<target name="docs.check" description="Check if documentations were built">
<condition property="docs.exist">
<available file="${workdir}/sources/documentation" type="dir"/>
</condition>
</target>
<target name="downloads.check" description="Check if downloads were built">
<condition property="downloads.exist">
<available file="${workdir}/downloads" type="dir"/>
</condition>
</target>
<target name="api.check" description="Check if javadocs were built">
<condition property="api.exist">
<available file="${workdir}/sources/narayana/narayana-full/target/narayana-full-${tag}-javadoc.jar"/>
</condition>
</target>
</project>
Something went wrong with that request. Please try again.