New property maven.site.gunzip.options can be used to set options when using gunzip (default value is -f).

MPSITE-39 : Deploy site on unix create rights rwxr-xr-x. Group members can't override files. The default value for maven.site.chmod.mode is now 755.
Split remote tasks to be sure to execute all of them if maven.site.failonerror=false

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@327739 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2005-10-23 03:59:48 +00:00
parent 65049157d2
commit 9d52f1b92a
4 changed files with 30 additions and 8 deletions

View File

@ -162,7 +162,7 @@
<!-- This needs to taken from the project properties --> <!-- This needs to taken from the project properties -->
<property name="maven.homepage" value="${siteDirectory}"/> <property name="maven.homepage" value="${siteDirectory}"/>
<echo>Creating site archive</echo>
<tar tarfile="${maven.build.dir}/${maven.final.name}-site.tar" basedir="${docsDest}"/> <tar tarfile="${maven.build.dir}/${maven.final.name}-site.tar" basedir="${docsDest}"/>
<gzip zipfile="${maven.build.dir}/${maven.final.name}-site.tar.gz" src="${maven.build.dir}/${maven.final.name}-site.tar"/> <gzip zipfile="${maven.build.dir}/${maven.final.name}-site.tar.gz" src="${maven.build.dir}/${maven.final.name}-site.tar"/>
<delete file="${maven.build.dir}/${maven.final.name}-site.tar"/> <delete file="${maven.build.dir}/${maven.final.name}-site.tar"/>
@ -173,20 +173,32 @@
<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>
<echo>Creating remote site directory</echo>
<!-- 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="${maven.site.failonerror}"> <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>
<echo>Copying site archive to the remote host</echo>
<exec dir="${maven.build.dir}" executable="${maven.scp.executable}" failonerror="${maven.site.failonerror}"> <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>
<echo>Unzipping site archive on the remote host</echo>
<exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}"> <exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'cd ${maven.homepage} &amp;&amp; rm -f ${maven.final.name}-site.tar &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.site.gunzip.options} ${maven.final.name}-site.tar.gz'"/>
</exec> </exec>
<echo>Untarring site archive on the remote host</echo>
<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.tar.executable} ${maven.site.tar.options} ${maven.final.name}-site.tar'"/>
</exec>
<echo>Updating files modes on the remote host</echo>
<exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'cd ${maven.homepage} &amp;&amp; chmod ${maven.site.chmod.options} ${maven.site.chmod.mode} * .'"/>
</exec>
<echo>Deleting remote archive</echo>
<exec dir="." executable="${maven.ssh.executable}" failonerror="${maven.site.failonerror}">
<arg line="${maven.ssh.args} -l ${siteUsername} ${siteAddress} 'cd ${maven.homepage} &amp;&amp; rm ${maven.final.name}-site.tar'"/>
</exec>
<echo>Deleting local archive</echo>
<delete file="${maven.build.dir}/${maven.final.name}-site.tar.gz"/> <delete file="${maven.build.dir}/${maven.final.name}-site.tar.gz"/>
</goal> </goal>

View File

@ -29,8 +29,9 @@ maven.site.deploy.method=ssh
maven.site.tar.executable=tar maven.site.tar.executable=tar
maven.site.tar.options=xvf maven.site.tar.options=xvf
maven.site.gunzip.executable=gunzip maven.site.gunzip.executable=gunzip
maven.site.gunzip.options=-fn
maven.site.chmod.options=-Rf maven.site.chmod.options=-Rf
maven.site.chmod.mode=g+u maven.site.chmod.mode=775
maven.site.failonerror=true maven.site.failonerror=true
maven.rsync.executable=rsync maven.rsync.executable=rsync

View File

@ -23,8 +23,10 @@
</properties> </properties>
<body> <body>
<release version="1.7-SNAPSHOT" date="In SVN"> <release version="1.7-SNAPSHOT" date="In SVN">
<action dev="aheritier" type="add">New property <code>maven.site.gunzip.options</code> can be used to set options when using gunzip (default value is -f).</action>
<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="aheritier" type="fix" issue="MPSITE-39">Deploy site on unix create rights rwxr-xr-x. Group members can't override files. The default value for <code>maven.site.chmod.mode</code> is now <code>755</code>.</action>
<action dev="aheritier" type="add" issue="MPSITE-34">New property <code>maven.site.failonerror</code> can be used to 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

@ -175,6 +175,13 @@
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.gunzip.options</td>
<td>Yes</td>
<td>
Specifies options passed to the gunzip executable. Default is '<code>-f</code>'.
</td>
</tr>
<tr> <tr>
<td>maven.site.failonerror</td> <td>maven.site.failonerror</td>
<td>Yes</td> <td>Yes</td>