blob: ae935d553b98368298b90efb78e8c93ae128162e [file] [log] [blame]
<!--
*************************************************************************
* Copyright (c) 2004, 2014 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial implementation
*
*************************************************************************
-->
<project default="main">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<property name="username" value="xgu"/>
<property name="password" value="xx"/>
<property name="hostname" value="build.eclipse.org"/>
<property name="username_sign" value="${username}"/>
<property name="password_sign" value="${password}"/>
<property name="hostname_sign" value="build.eclipse.org"/>
<property name="dtp.buildhome" value="/home/adb/releng.dtp.1120"/>
<property name="dtp.builddir" value="${dtp.buildhome}/org.eclipse.datatools.releng.builder"/>
<property name="postingDirectory" value="/home/adb/releng/BIRTOutput/dtp.output/1.12.0"/>
<property name="upload_workdir" value="${dtp.builddir}/uploadScripts/workdir"/>
<property name="sign_path" value="${upload_workdir}/UpdateSiteUpload"/>
<property name="LocalUpdatesiteDir" value="${upload_workdir}/UpdateSite/dtp_1.12.0"/>
<property name="DTP.website.repo" value="${dtp.builddir}/uploadScripts/datatools"/>
<property file="${postingDirectory}/monitor.properties"/>
<property name="local_dtp_path" value="${postingDirectory}/${buildId}"/>
<property name="eclipse_dtp_path" value="~/downloads/datatools/downloads/drops/N_DTP_1.12.0"/>
<property name="eclipse_staging_path" value="/home/data/httpd/download-staging.priv/birt"/>
<!--property name="local_version" value="RC3"/-->
<property name="M_version" value="RC3"/>
<tstamp prefix="timestamp">
<format property="date" pattern="yyyyMMdd" locale="en" />
</tstamp>
<target name="checkMonitor">
<available property="isUpload" file="${postingDirectory}/monitor.properties" />
</target>
<target name="main" depends="checkMonitor" if="isUpload">
<if>
<equals arg1="${compileHasError}" arg2="false"/>
<then>
<echo file="${dtp.buildhome}/dtpURLmonitor.properties">
dtpURL=http://download.eclipse.org/datatools/downloads/drops/N_DTP_1.12.0/dtp-1.12.0${M_version}-${timestamp}.zip
dtpSdkURL=http://download.eclipse.org/datatools/downloads/drops/N_DTP_1.12.0/dtp-sdk-1.12.0${M_version}-${timestamp}.zip
dtpP2URL=http://download.eclipse.org/datatools/downloads/drops/N_DTP_1.12.0/dtp-p2repo-1.12.0${M_version}-${timestamp}.zip
file-version=dtp-1.12.0${M_version}-${timestamp}
SdkFileVersion=dtp-sdk-1.12.0${M_version}-${timestamp}
P2FileVersion=dtp-p2repo-1.12.0${M_version}-${timestamp}
currentDay=${timestamp.date}
</echo>
<ant antfile="dtplogupload.1.12.0.xml" target="main"/>
<antcall target="dtpupload"/>
<antcall target="dtpP2upload"/>
<!--antcall target="signing"/-->
<antcall target="updategitfile"/>
<antcall target="inform"/>
<antcall target="finishlogupload"/>
</then>
<elseif>
<equals arg1="${compileHasError}" arg2="true"/>
<then>
<antcall target="CompileError"/>
</then>
</elseif>
<else>
<antcall target="BuildError"/>
</else>
</if>
</target>
<target name="dtpupload">
<property name="temp.dir" value="${dtp.builddir}/uploadScripts/workdir/temp"/>
<tstamp>
<format property="dtp.upload.start" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<echo message="Start to dtp upload at ${dtp.upload.start}"/>
<scp todir="${username}:${password}@${hostname}:${eclipse_dtp_path}" trust="true">
<fileset dir="${local_dtp_path}" includes="dtp-sdk-1.12.0${M_version}-${timestamp}.zip,dtp-1.12.0${M_version}-${timestamp}.zip,dtp-p2repo-1.12.0${M_version}-${timestamp}.zip"/>
</scp>
<scp remoteTofile="${username}:${password}@${hostname}:${eclipse_dtp_path}/directory_N.txt" trust="true"
file="${local_dtp_path}/directory.txt"/>
<sshexec host="${hostname}" username="${username}" password="${password}" trust="true"
failonerror="false"
command="chmod g+w ${eclipse_dtp_path}/dtp-*1.12.0${M_version}-${timestamp}.zip ${eclipse_dtp_path}/directory_N.txt" />
</target>
<target name="dtpP2upload">
<sshexec host="${hostname}" username="${username}" password="${password}" trust="true"
command="unzip -q -o ${eclipse_dtp_path}/dtp-p2repo-1.12.0${M_version}-${timestamp}.zip -d ${eclipse_dtp_path}/../N_updates_1.12.0/${buildId}"/>
<scp todir="${username}:${password}@${hostname}:${eclipse_dtp_path}/../N_updates_1.12.0" trust="true">
<fileset dir="${LocalUpdatesiteDir}" includes="compositeArtifacts.jar,compositeContent.jar"/>
</scp>
<sshexec host="${hostname}" username="${username}" password="${password}" trust="true"
failonerror="false"
command="chmod -R g+w ${eclipse_dtp_path}/../N_updates_1.12.0/*.jar ${eclipse_dtp_path}/../N_updates_1.12.0/${buildId}" />
</target>
<target name="signing">
<sshexec host="${hostname_sign}" username="${username_sign}" password="${password_sign}" trust="true"
command="cd ${eclipse_staging_path};cp ${eclipse_dtp_path}/*1.12.0${M_version}-${timestamp}.zip ./;sign dtp-sdk-1.12.0${M_version}-${timestamp}.zip nomail;sign dtp-1.12.0${M_version}-${timestamp}.zip nomail;sign dtp-incubator-sdk-1.12.0${M_version}-${timestamp}.zip nomail;sign dtp-incubator-1.12.0${M_version}-${timestamp}.zip nomail"/>
<sleep minutes="50"/>
<scp todir="${sign_path}/SignPack" trust="true"
file="${username_sign}:${password_sign}@${hostname_sign}:${eclipse_staging_path}/dtp-sdk-1.12.0${M_version}-${timestamp}.zip"/>
<copy todir="${local_dtp_path}" failonerror="false" overwrite="true">
<fileset dir="${sign_path}/SignPack" includes="dtp-sdk-1.12.0${M_version}-${timestamp}.zip"/>
</copy>
<scp todir="${sign_path}/SignPack" trust="true"
file="${username_sign}:${password_sign}@${hostname_sign}:${eclipse_staging_path}/dtp-1.12.0${M_version}-${timestamp}.zip"/>
<copy todir="${local_dtp_path}" failonerror="false" overwrite="true">
<fileset dir="${sign_path}/SignPack" includes="dtp-1.12.0${M_version}-${timestamp}.zip"/>
</copy>
<scp todir="${sign_path}/SignPack" trust="true"
file="${username_sign}:${password_sign}@${hostname_sign}:${eclipse_staging_path}/dtp-incubator-sdk-1.12.0${M_version}-${timestamp}.zip"/>
<copy todir="${local_dtp_path}" failonerror="false" overwrite="true">
<fileset dir="${sign_path}/SignPack" includes="dtp-incubator-sdk-1.12.0${M_version}-${timestamp}.zip"/>
</copy>
<scp todir="${sign_path}/SignPack" trust="true"
file="${username_sign}:${password_sign}@${hostname_sign}:${eclipse_staging_path}/dtp-incubator-1.12.0${M_version}-${timestamp}.zip"/>
<copy todir="${local_dtp_path}" failonerror="false" overwrite="true">
<fileset dir="${sign_path}/SignPack" includes="dtp-incubator-1.12.0${M_version}-${timestamp}.zip"/>
</copy>
<scp todir="${username}:${password}@${hostname}:${eclipse_dtp_path}" trust="true">
<fileset dir="${sign_path}/SignPack" includes="dtp-sdk-1.12.0${M_version}-${timestamp}.zip,dtp-1.12.0${M_version}-${timestamp}.zip,dtp-incubator-sdk-1.12.0${M_version}-${timestamp}.zip,dtp-incubator-1.12.0${M_version}-${timestamp}.zip,directory.txt"/>
</scp>
</target>
<target name="updategitfile">
<property name="integrationBuild" value="false"/>
<property file="lastmonitor_N_1120.properties"/>
<property file="lastmonitor_I_1120.properties"/>
<tstamp>
<format property="downloads.php.pattern" pattern="M/d/yy"/>
</tstamp>
<!--cvs command="update -C downloads.php" dest="www/datatools"/-->
<echo message="Git pull ${DTP.website.repo}"/>
<exec executable="git" dir="${DTP.website.repo}">
<arg line="pull origin master" />
</exec>
<echo message="Updating downloads.php matching pattern: dtp-sdk-1\.12\.0${lastMversion_N}-${lasttimestamp_N}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_N} SDK.*Nightly Build(.*)dtp-sdk-1\.12\.0${lastMversion_N}-${lasttimestamp_N}"/>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-sdk-1\.12\.0${lastMversion_N}-${lasttimestamp_N}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_N} SDK.*Nightly Build(.*)dtp-sdk-1\.12\.0${lastMversion_N}-${lasttimestamp_N}"
replace="dtp-sdk-1.12.0${M_version}-${timestamp}.zip\1\2DTP 1.12.0${M_version} SDK ${downloads.php.pattern} Nightly Build\3dtp-sdk-1.12.0${M_version}-${timestamp}"/>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-1\.12\.0${lastMversion_N}-${lasttimestamp_N}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_N}.*Nightly Build(.*)dtp-1\.12\.0${lastMversion_N}-${lasttimestamp_N}"
replace="dtp-1.12.0${M_version}-${timestamp}.zip\1\2DTP 1.12.0${M_version} ${downloads.php.pattern} Nightly Build\3dtp-1.12.0${M_version}-${timestamp}"/>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-p2repo-1\.12\.0${lastMversion_N}-${lasttimestamp_N}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_N} P2 Repo.*Nightly Build(.*)dtp-p2repo-1\.12\.0${lastMversion_N}-${lasttimestamp_N}"
replace="dtp-p2repo-1.12.0${M_version}-${timestamp}.zip\1\2DTP 1.12.0${M_version} P2 Repo ${downloads.php.pattern} Nightly Build\3dtp-p2repo-1.12.0${M_version}-${timestamp}"/>
<!--replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-incubator-sdk-1\.12\.0${lastMversion_N}-${lasttimestamp_N}\.zip(.*)(\s*)DTP Incubator 1\.12\.0${lastMversion_N} SDK.*Nightly Build(.*)dtp-incubator-sdk-1\.12\.0${lastMversion_N}-${lasttimestamp_N}"
replace="dtp-incubator-sdk-1.12.0${M_version}-${timestamp}.zip\1\2DTP Incubator 1.12.0${M_version} SDK ${downloads.php.pattern} Nightly Build\3dtp-incubator-sdk-1.12.0${M_version}-${timestamp}"/>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-incubator-1\.12\.0${lastMversion_N}-${lasttimestamp_N}\.zip(.*)(\s*)DTP Incubator 1\.12\.0${lastMversion_N}.*Nightly Build(.*)dtp-incubator-1\.12\.0${lastMversion_N}-${lasttimestamp_N}"
replace="dtp-incubator-1.12.0${M_version}-${timestamp}.zip\1\2DTP Incubator 1.12.0${M_version} ${downloads.php.pattern} Nightly Build\3dtp-incubator-1.12.0${M_version}-${timestamp}"/-->
<if>
<equals arg1="${integrationBuild}" arg2="true"/>
<then>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-sdk-1\.12\.0${lastMversion_I}-${lasttimestamp_I}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_I} SDK.*I-Build(.*)dtp-sdk-1\.12\.0${lastMversion_I}-${lasttimestamp_I}"
replace="dtp-sdk-1.12.0${M_version}-${timestamp}.zip\1\2DTP 1.12.0${M_version} SDK ${downloads.php.pattern} I-Build\3dtp-sdk-1.12.0${M_version}-${timestamp}"/>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-1\.12\.0${lastMversion_I}-${lasttimestamp_I}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_I}.*I-Build(.*)dtp-1\.12\.0${lastMversion_I}-${lasttimestamp_I}"
replace="dtp-1.12.0${M_version}-${timestamp}.zip\1\2DTP 1.12.0${M_version} ${downloads.php.pattern} I-Build\3dtp-1.12.0${M_version}-${timestamp}"/>
<replaceregexp file="${DTP.website.repo}/downloads.php"
match="dtp-p2repo-1\.12\.0${lastMversion_I}-${lasttimestamp_I}\.zip(.*)(\s*)DTP 1\.12\.0${lastMversion_I} P2 Repo.*I-Build(.*)dtp-p2repo-1\.12\.0${lastMversion_I}-${lasttimestamp_I}"
replace="dtp-p2repo-1.12.0${M_version}-${timestamp}.zip\1\2DTP 1.12.0${M_version} P2 Repo ${downloads.php.pattern} I-Build\3dtp-p2repo-1.12.0${M_version}-${timestamp}"/>
<scp remoteTofile="${username}:${password}@${hostname}:${eclipse_dtp_path}/directory_I.txt" trust="true"
file="${local_dtp_path}/directory.txt"/>
<sshexec host="${hostname}" username="${username}" password="${password}" trust="true"
failonerror="false"
command="chmod g+w ${eclipse_dtp_path}/directory_I.txt" />
</then>
</if>
<!--cvs command="commit -m 'update for 1.12.0 nightly build ${buildId}' downloads.php" dest="www/datatools"/-->
<exec executable="git" dir="${DTP.website.repo}">
<arg line="commit -a -m 'Update for 1.12.0 Nightly Build ${buildId}'" />
</exec>
<exec executable="git" dir="${DTP.website.repo}">
<arg line="push origin master" />
</exec>
<echo file="lastmonitor_N_1120.properties">
lasttimestamp_N=${timestamp}
lastMversion_N=${M_version}
</echo>
<if>
<equals arg1="${integrationBuild}" arg2="true"/>
<then>
<echo file="lastmonitor_I_1120.properties">
lasttimestamp_I=${timestamp}
lastMversion_I=${M_version}
</echo>
</then>
</if>
</target>
<target name="inform">
<mail from="DAILYBUILD@QA-SHA" tolist="xgu@actuate.com,lchan@actuate.com,bpayton@us.ibm.com" mailport="5025"
subject="Today's DTP 1.12.0 build is available (${buildId})">
<message>
Hi All,
Today's DTP build is available at:
SDK package: http://www.eclipse.org/downloads/download.php?file=/datatools/downloads/drops/N_DTP_1.12.0/dtp-sdk-1.12.0${M_version}-${timestamp}.zip
Non-SDK package: http://www.eclipse.org/downloads/download.php?file=/datatools/downloads/drops/N_DTP_1.12.0/dtp-1.12.0${M_version}-${timestamp}.zip
P2 Repo package: http://www.eclipse.org/downloads/download.php?file=/datatools/downloads/drops/N_DTP_1.12.0/dtp-p2repo-1.12.0${M_version}-${timestamp}.zip
</message>
</mail>
</target>
<target name="finishlogupload">
<ant antfile="dtplogupload.1.12.0.xml" target="copytoeclipse">
<property name="up_status" value="finish"/>
</ant>
</target>
<target name="CompileError">
<property file="${dtp.builddir}/monitor.properties" />
<property file="${dtp.builddir}/config.properties" />
<echo message="${mail.port}"/>
<echo message="${buildId}"/>
<echo message="${COMPILE.ERROR.RECIPIENTS}"/>
<echo message="${mail.from}"/>
<echo message="${replyto.address}"/>
<echo message="${error.plugin.list}"/>
<echo message="compile log location: ${postingDirectory}/${buildId}/compilelogs/plugins"/>
<mail mailport="${mail.port}" subject="Compile errors found in Today's Datatools 1.12.0 Build (BuildId: ${buildId} )" tolist="${COMPILE.ERROR.RECIPIENTS}">
<from address="${mail.from}"/>
<replyto address="${replyto.address}"/>
<message>
Hi All,
Compile errors are found in today's DTP 1.12.0 build(BuildId: ${buildId}):
${error.plugin.list}
Please see the attachments for details.
Have a nice day!
</message>
<attachments>
<fileset dir="${postingDirectory}/${buildId}/compilelogs/plugins">
<include name="*compilelog.html"/>
</fileset>
</attachments>
</mail>
</target>
<target name="BuildError">
<property file="${dtp.builddir}/monitor.properties" />
<property file="${dtp.builddir}/config.properties" />
<mail mailport="${mail.port}" subject="Build errors found in Today's Datatools 1.12.0 Build (BuildId: ${buildId} )" tolist="${BUILD.ERROR.RECIPIENTS}">
<from address="${mail.from}"/>
<replyto address="${replyto.address}"/>
<message>
Hi All,
Build errors are found in today's DTP 1.12.0 build(BuildId: ${buildId}):
Please refer to build.log for details:
http://www.eclipse.org/downloads/download.php?file=/datatools/downloads/drops/N_DTP_1.12.0/build.log
Have a nice day!
</message>
</mail>
</target>
</project>