MPSITE-34 : New property maven.site.failonerror can be used bypass remote errors.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@327734 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2005-10-23 03:21:04 +00:00
parent 5127dcf42c
commit c974670cf5
4 changed files with 19 additions and 10 deletions

View File

@ -169,21 +169,21 @@
<j:if test="${siteClean}"> <j:if test="${siteClean}">
<echo>Cleaning destination first</echo> <echo>Cleaning destination first</echo>
<exec dir="." executable="${maven.ssh.executable}" failonerror="true"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'rm -r ${siteDirectory}'" /> <arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'rm -r ${siteDirectory}'" />
</exec> </exec>
</j:if> </j:if>
<!-- Make sure the destination directory exists before trying to copy --> <!-- Make sure the destination directory exists before trying to copy -->
<exec dir="." executable="${maven.ssh.executable}" failonerror="true"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'mkdir -p ${maven.homepage}'"/> <arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'mkdir -p ${maven.homepage}'"/>
</exec> </exec>
<exec dir="${maven.build.dir}" executable="${maven.scp.executable}" failonerror="true"> <exec dir="${maven.build.dir}" executable="${maven.scp.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.scp.args} ${maven.final.name}-site.tar.gz ${siteUsername}@${siteAddress}:${maven.homepage}"/> <arg line="${maven.scp.args} ${maven.final.name}-site.tar.gz ${siteUsername}@${siteAddress}:${maven.homepage}"/>
</exec> </exec>
<exec dir="." executable="${maven.ssh.executable}" failonerror="true"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'cd ${maven.homepage} &amp;&amp; ${maven.site.gunzip.executable} ${maven.final.name}-site.tar.gz &amp;&amp; ${maven.site.tar.executable} ${maven.site.tar.options} ${maven.final.name}-site.tar &amp;&amp; chmod ${maven.site.chmod.options} ${maven.site.chmod.mode} * . &amp;&amp; rm ${maven.final.name}-site.tar'"/> <arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'cd ${maven.homepage} &amp;&amp; ${maven.site.gunzip.executable} ${maven.final.name}-site.tar.gz &amp;&amp; ${maven.site.tar.executable} ${maven.site.tar.options} ${maven.final.name}-site.tar &amp;&amp; chmod ${maven.site.chmod.options} ${maven.site.chmod.mode} * . &amp;&amp; rm ${maven.final.name}-site.tar'"/>
</exec> </exec>
@ -286,11 +286,11 @@
<echo>Executing filesystem copy on remote server to publish</echo> <echo>Executing filesystem copy on remote server to publish</echo>
<j:if test="${publishClean}"> <j:if test="${publishClean}">
<echo>Cleaning destination first</echo> <echo>Cleaning destination first</echo>
<exec dir="." executable="${maven.ssh.executable}"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'rm -r ${destSiteDirectory}'" /> <arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'rm -r ${destSiteDirectory}'" />
</exec> </exec>
</j:if> </j:if>
<exec dir="." executable="${maven.ssh.executable}"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'mkdir -p ${destSiteDirectory} &amp;&amp; cp -r ${siteDirectory}/* ${destSiteDirectory}'" /> <arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'mkdir -p ${destSiteDirectory} &amp;&amp; cp -r ${siteDirectory}/* ${destSiteDirectory}'" />
</exec> </exec>
</j:when> </j:when>
@ -301,7 +301,7 @@
<echo>Cleaning destination</echo> <echo>Cleaning destination</echo>
<j:set var="rsyncArgs" value="${rsyncArgs} --delete" /> <j:set var="rsyncArgs" value="${rsyncArgs} --delete" />
</j:if> </j:if>
<exec dir="." executable="${maven.ssh.executable}"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} '${maven.rsync.executable} ${rsyncArgs} -az ${siteDirectory}/* ${destSiteUsername}@${destSiteAddress}:${destSiteDirectory}'" /> <arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} '${maven.rsync.executable} ${rsyncArgs} -az ${siteDirectory}/* ${destSiteUsername}@${destSiteAddress}:${destSiteDirectory}'" />
</exec> </exec>
</j:otherwise> </j:otherwise>
@ -312,7 +312,7 @@
description="Deploy the generated site using rsync" description="Deploy the generated site using rsync"
prereqs="site:init,site:remote-deploy-init"> prereqs="site:init,site:remote-deploy-init">
<echo>rsyncing...</echo> <echo>rsyncing...</echo>
<exec dir="." executable="${maven.ssh.executable}" failonerror="true"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${siteUsername}@${siteAddress} 'mkdir -p ${siteDirectory}'" /> <arg line="${siteUsername}@${siteAddress} 'mkdir -p ${siteDirectory}'" />
</exec> </exec>
@ -322,7 +322,7 @@
<j:set var="rsyncArgs" value="${rsyncArgs} --delete" /> <j:set var="rsyncArgs" value="${rsyncArgs} --delete" />
</j:if> </j:if>
<!-- Note: trailing slash is important! --> <!-- Note: trailing slash is important! -->
<exec dir="." executable="${maven.rsync.executable}" failonerror="true"> <exec dir="." executable="${maven.rsync.executable}" failonerror="${maven.site.failonerror}">
<arg line="-az ${rsyncArgs} ${relativeDocsDest}/ ${siteUsername}@${siteAddress}:${siteDirectory}" /> <arg line="-az ${rsyncArgs} ${relativeDocsDest}/ ${siteUsername}@${siteAddress}:${siteDirectory}" />
</exec> </exec>
</goal> </goal>

View File

@ -31,6 +31,7 @@ maven.site.tar.options=xvf
maven.site.gunzip.executable=gunzip maven.site.gunzip.executable=gunzip
maven.site.chmod.options=-Rf maven.site.chmod.options=-Rf
maven.site.chmod.mode=g+u maven.site.chmod.mode=g+u
maven.site.failonerror=true
maven.rsync.executable=rsync maven.rsync.executable=rsync

View File

@ -24,6 +24,7 @@
<body> <body>
<release version="1.7-SNAPSHOT" date="In SVN"> <release version="1.7-SNAPSHOT" date="In SVN">
<action dev="ltheussl" type="fix" issue="MPSITE-40">Missing <code>maven.ssh.args</code> in <code>site:publish</code>.</action> <action dev="ltheussl" type="fix" issue="MPSITE-40">Missing <code>maven.ssh.args</code> in <code>site:publish</code>.</action>
<action dev="aheritier" type="update" issue="MPSITE-34">New property <code>maven.site.failonerror</code> can be used bypass remote errors.</action>
<action dev="ltheussl" type="add" issue="MPSITE-31">Make <code>chmod</code> options in <code>site:sshdeploy</code> configurable.</action> <action dev="ltheussl" type="add" issue="MPSITE-31">Make <code>chmod</code> options in <code>site:sshdeploy</code> configurable.</action>
<action dev="ltheussl" type="fix" issue="MPSITE-24" due-to="Julian Dunn">SSH arguments not used in <code>sshdeploy</code> with 'clean'.</action> <action dev="ltheussl" type="fix" issue="MPSITE-24" due-to="Julian Dunn">SSH arguments not used in <code>sshdeploy</code> with 'clean'.</action>
<action dev="aheritier" type="fix" issue="MPSITE-28" due-to="Davy Toch">Deploying the site documentation through SSH always results in 'Build Successful'.</action> <action dev="aheritier" type="fix" issue="MPSITE-28" due-to="Davy Toch">Deploying the site documentation through SSH always results in 'Build Successful'.</action>

View File

@ -166,7 +166,6 @@
<code>U</code> option. <code>U</code> option.
</td> </td>
</tr> </tr>
<tr> <tr>
<td>maven.site.gunzip.executable</td> <td>maven.site.gunzip.executable</td>
<td>Yes</td> <td>Yes</td>
@ -176,6 +175,14 @@
system has a default version of gunzip that is failing. system has a default version of gunzip that is failing.
</td> </td>
</tr> </tr>
<tr>
<td>maven.site.failonerror</td>
<td>Yes</td>
<td>
Specifies if remote commands errors must stop the build.
Defaults to <code>true</code>.
</td>
</tr>
</table> </table>
</section> </section>
<section name="Using Putty as ssh client"> <section name="Using Putty as ssh client">