| <?xml version="1.0" encoding="UTF-8"?> |
| <project name="build-packaging" xmlns:ivy="antlib:org.apache.ivy.ant"> |
| <path id="bundles"> |
| </path> |
| |
| <property file="${basedir}/../build.properties"/> |
| <property file="${basedir}/../build.versions"/> |
| |
| <property name="javaprofile.location" value="${basedir}/nano/configuration/java6-server.profile"/> |
| |
| <import file="${basedir}/sign.xml"/> |
| <import file="${basedir}/../virgo-build/multi-bundle/default.xml"/> |
| <import file="${basedir}/nano/build-nano.xml"/> |
| <import file="${basedir}/kernel/build-kernel.xml"/> |
| <import file="${basedir}/tomcat-server/build-tomcat-server.xml"/> |
| <import file="${basedir}/jetty-server/build-jetty-server.xml"/> |
| |
| <property name="nano.target.dir" value="${target.dir}/nano"/> |
| <property name="kernel.target.dir" value="${target.dir}/kernel"/> |
| <property name="tomcat-server.target.dir" value="${target.dir}/tomcat-server"/> |
| <property name="jetty-server.target.dir" value="${target.dir}/jetty-server"/> |
| |
| <target name="precommit" depends="clean, clean-integration, test, findbugs, package, smoke-test" |
| description="Performs a CI server-like build, should be run prior to performing a Git push"/> |
| |
| <target name="package" depends="ivy.init, fetch-unzipped-virgo-build-tools"> |
| <antcall target="package-bundles-and-features"/> |
| <antcall target="package-resources-and-products"/> |
| <antcall target="package-distros"/> |
| |
| <zip destfile="${updatesite.output.file}" update="yes"> |
| <zipfileset dir="${p2.repository.dir}"/> |
| </zip> |
| |
| <antcall target="clean-up"/> |
| <delete dir="${tools.dir}" quiet="true"/> |
| </target> |
| |
| <target name="package-signed" depends="ivy.init, fetch-unzipped-virgo-build-tools"> |
| <antcall target="package-bundles-and-features"/> |
| <!-- additional signing steps start --> |
| <antcall target="sign-updatesite"/> |
| <antcall target="republish-bundles-and-features"/> |
| <!-- additional signing steps end --> |
| <antcall target="package-resources-and-products"/> |
| <antcall target="package-distros"/> |
| |
| <zip destfile="${updatesite.output.file}" update="yes"> |
| <zipfileset dir="${p2.repository.dir}"/> |
| </zip> |
| |
| <antcall target="clean-up"/> |
| <delete dir="${tools.dir}" quiet="true"/> |
| </target> |
| |
| <target name="package-bundles-and-features"> |
| <delete dir="${package.output.dir}" quiet="true"/> |
| <mkdir dir="${package.output.dir}"/> |
| |
| <antcall target="nano.prepare-bundles-and-features"/> |
| <antcall target="nano.publish-bundles-and-features"/> |
| <antcall target="kernel.prepare-bundles-and-features"/> |
| <antcall target="kernel.publish-bundles-and-features"/> |
| <antcall target="vjs.prepare-bundles-and-features"/> |
| <antcall target="vjs.publish-bundles-and-features"/> |
| <antcall target="vts.prepare-bundles-and-features"/> |
| <antcall target="vts.publish-bundles-and-features"/> |
| |
| <zip destfile="${updatesite.output.file}" update="yes"> |
| <zipfileset dir="${p2.repository.dir}"/> |
| </zip> |
| </target> |
| |
| <target name="package-resources-and-products"> |
| <delete dir="${package.output.dir}" quiet="true"/> |
| <mkdir dir="${package.output.dir}"/> |
| |
| <antcall target="nano.package-resources-and-products"/> |
| <antcall target="kernel.package-resources-and-products"/> |
| <antcall target="vjs.package-resources-and-products"/> |
| <antcall target="vts.package-resources-and-products"/> |
| </target> |
| |
| <target name="package-distros"> |
| <antcall target="nano.package-distros"/> |
| <antcall target="kernel.package-distro"/> |
| <antcall target="vjs.package-distro"/> |
| <antcall target="vts.package-distro"/> |
| </target> |
| |
| <target name="clean-up"> |
| <antcall target="nano.clean-up"/> |
| <antcall target="kernel.clean-up"/> |
| <antcall target="vjs.clean-up"/> |
| <antcall target="vts.clean-up"/> |
| </target> |
| |
| <target name="smoke-test"> |
| <antcall target="smoke-test-nano"/> |
| <antcall target="smoke-test-kernel"/> |
| <antcall target="smoke-test-jetty-server"/> |
| <antcall target="smoke-test-tomcat-server"/> |
| </target> |
| |
| <property name="nano.package.file" value="${artifacts.dir}/virgo-nano-${bundle.version}.zip"/> |
| <property name="nano.full.package.file" value="${artifacts.dir}/virgo-nano-full-${bundle.version}.zip"/> |
| <property name="nano.rap.package.file" value="${artifacts.dir}/virgo-nano-rap-${bundle.version}.zip"/> |
| <property name="kernel.package.file" value="${artifacts.dir}/virgo-kernel-${bundle.version}.zip"/> |
| <property name="tomcat-server.package.file" value="${artifacts.dir}/virgo-tomcat-server-${bundle.version}.zip"/> |
| <property name="jetty-server.package.file" value="${artifacts.dir}/virgo-jetty-server-${bundle.version}.zip"/> |
| |
| <target name="publish-packages-build"> |
| <antcall target="publish-package-build"> |
| <param name="package.file" value="${nano.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-build"> |
| <param name="package.file" value="${nano.full.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-build"> |
| <param name="package.file" value="${nano.rap.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-build"> |
| <param name="package.file" value="${kernel.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-build"> |
| <param name="package.file" value="${jetty-server.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-build"> |
| <param name="package.file" value="${tomcat-server.package.file}"/> |
| </antcall> |
| </target> |
| |
| <target name="publish-packages-download"> |
| <antcall target="publish-package-download"> |
| <param name="package.file" value="${nano.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-download"> |
| <param name="package.file" value="${nano.full.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-download"> |
| <param name="package.file" value="${nano.rap.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-download"> |
| <param name="package.file" value="${kernel.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-download"> |
| <param name="package.file" value="${jetty-server.package.file}"/> |
| </antcall> |
| <antcall target="publish-package-download"> |
| <param name="package.file" value="${tomcat-server.package.file}"/> |
| </antcall> |
| </target> |
| |
| <target name="publish-updatesite-download"> |
| <fail message="The 'project.name' property must be set on this project."> |
| <condition> |
| <not> |
| <isset property="project.name"/> |
| </not> |
| </condition> |
| </fail> |
| <checksum file="${updatesite.output.file}" algorithm="sha1"/> |
| <sshexec host="build.eclipse.org" |
| username="${eclipse.committerId}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" |
| command="mkdir -pv /home/data/httpd/download.eclipse.org/virgo/updatesite-zipped/${bundle.version}"/> |
| <sshexec host="build.eclipse.org" |
| username="${eclipse.committerId}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" |
| command="mkdir -pv /home/data/httpd/download.eclipse.org/virgo/updatesite/${bundle.version}"/> |
| <scp localFile="${updatesite.output.file}" |
| todir="${eclipse.committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/virgo/updatesite-zipped/${bundle.version}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" /> |
| <scp localFile="${updatesite.output.file}.sha1" |
| todir="${eclipse.committerId}@build.eclipse.org:/home/data/httpd/download.eclipse.org/virgo/updatesite-zipped/${bundle.version}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" /> |
| <sshexec host="build.eclipse.org" |
| username="${eclipse.committerId}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" |
| command="unzip /home/data/httpd/download.eclipse.org/virgo/updatesite-zipped/${bundle.version}/${updatesite.file.name} -d /home/data/httpd/download.eclipse.org/virgo/updatesite/${bundle.version}"/> |
| </target> |
| |
| <!-- used only for signing --> |
| <target name="sign-updatesite"> |
| <!-- clean up the published xmls and zip it --> |
| <delete file="${p2.repository.dir}/content.jar"/> |
| <delete file="${p2.repository.dir}/artifacts.jar"/> |
| <delete file="${updatesite.output.file}"/> |
| <zip destfile="${updatesite.output.file}"> |
| <zipfileset dir="${p2.repository.dir}"/> |
| </zip> |
| |
| <property name="stagingDirectory" value="/opt/public/download-staging.priv/rt/virgo"/> |
| <property name="stagingDirectoryOutput" value="${stagingDirectory}/signed" /> |
| <property name="archiveName" value="${updatesite.file.name}"/> |
| |
| <!-- upload zipped p2 repo to sign machine --> |
| <scp localFile="${updatesite.output.file}" |
| todir="${eclipse.committerId}@build.eclipse.org:${stagingDirectory}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" /> |
| |
| <!-- execute sign --> |
| <sshexec host="build.eclipse.org" |
| username="${eclipse.committerId}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" |
| command="/usr/bin/sign ${stagingDirectory}/${archiveName} nomail ${stagingDirectoryOutput}"/> |
| |
| <!-- wait for sign to complete --> |
| <antcall target="waitForSign"> |
| <param name="stagingDirectory" value="${stagingDirectory}"/> |
| <param name="archiveName" value="${archiveName}"/> |
| </antcall> |
| <sleep seconds="30"/> |
| |
| <!-- pull signed p2 repo --> |
| <scp remoteFile="${eclipse.committerId}@build.eclipse.org:${stagingDirectoryOutput}/${archiveName}" |
| localTodir="${target.dir}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" /> |
| |
| <!-- backup and replace original p2 repo --> |
| <exec executable="mv"> |
| <arg value="${p2.repository.dir}"/> |
| <arg value="${p2.repository.dir}.backup"/> |
| </exec> |
| <unzip src="${target.dir}/${archiveName}" dest="${p2.repository.dir}"/> |
| |
| <!-- clean up sign machine --> |
| <sshexec host="build.eclipse.org" |
| username="${eclipse.committerId}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" |
| command="rm -r ${stagingDirectoryOutput}"/> |
| |
| <sshexec host="build.eclipse.org" |
| username="${eclipse.committerId}" |
| keyfile="${key.file}" |
| passphrase="${passphrase}" |
| command="rm ${stagingDirectory}/${archiveName}"/> |
| </target> |
| |
| <!-- used only for signing --> |
| <target name="republish-bundles-and-features"> |
| <delete dir="${package.output.dir}" quiet="true"/> |
| <mkdir dir="${package.output.dir}"/> |
| |
| <antcall target="p2.publish-bundles-features"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="source" value="${p2.repository.dir}"/> |
| </antcall> |
| |
| <zip destfile="${updatesite.output.file}" update="yes"> |
| <zipfileset dir="${p2.repository.dir}"/> |
| </zip> |
| </target> |
| |
| </project> |