forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r381280 - in /forrest/trunk: site-author/content/xdocs/tools/forrestbot.xml site-author/status.xml tools/forrestbot/core/deploy.xml
Date Mon, 27 Feb 2006 07:47:35 GMT
Author: crossley
Date: Sun Feb 26 23:47:30 2006
New Revision: 381280

URL: http://svn.apache.org/viewcvs?rev=381280&view=rev
Log:
Forrestbot deploy.scp workstage now uses keyfile/passphrase in preference,
then fallback to remote password.
Issue: FOR-818

Modified:
    forrest/trunk/site-author/content/xdocs/tools/forrestbot.xml
    forrest/trunk/site-author/status.xml
    forrest/trunk/tools/forrestbot/core/deploy.xml

Modified: forrest/trunk/site-author/content/xdocs/tools/forrestbot.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/site-author/content/xdocs/tools/forrestbot.xml?rev=381280&r1=381279&r2=381280&view=diff
==============================================================================
--- forrest/trunk/site-author/content/xdocs/tools/forrestbot.xml (original)
+++ forrest/trunk/site-author/content/xdocs/tools/forrestbot.xml Sun Feb 26 23:47:30 2006
@@ -19,7 +19,7 @@
 "http://forrest.apache.org/dtd/document-v12.dtd">
 <document>
   <header>
-    <title>Forrestbot</title>
+    <title>Forrestbot - automated building and deploying</title>
   </header>
 
   <body>
@@ -88,6 +88,9 @@
   <property name="deploy.scp.dest" 
       value="username@myhost.com:/var/www/mydomain/htdocs"/>
 
+  <!-- here we declare the ssh keyfile and passphrase in an external file -->
+  <import file="../deploy-settings.xml" optional="true"/>
+
   <!-- here we specify to use two notification implementations -->
   <target name="notify" depends="notify.local, notify.email"/>
 
@@ -469,14 +472,14 @@
         <section id="deploy.scp">
           <title>deploy.scp</title>
 
-          <p><code>${user.home}/.ssh/known_hosts</code> must properly
+          <p>The <code>${user.home}/.ssh/known_hosts</code> must properly
           recognize the host, so you should manually make an ssh connection to
           the host if you never have before.</p>
 
-          <p>Currently only using password-based scp. It would be trivial to add
-          key-based authentication (see
-          <link href="http://issues.apache.org/jira/browse/FOR-818">FOR-818</link>).
-          </p>
+          <p>If <code>${deploy.scp.keyfile}</code>is defined, then it will
use
+          key-based authentication in preference. Otherwise it will use
+          <code>${deploy.scp.password}</code></p>
+
           <table>
             <tr>
               <th>Property</th>
@@ -500,13 +503,42 @@
             </tr>
 
             <tr>
+              <td>deploy.scp.keyfile</td>
+
+              <td>Location of the local file holding the private key.
+              Usually /home/me/.ssh/id_dsa or /home/me/.ssh/id_rsa
+              <br />
+              Note that the deploy.scp.passphrase must also be supplied.
+              </td>
+
+              <td></td>
+
+              <td>No. However, if this is not supplied then scp will fallback
+              to use the less secure deploy.scp.password</td>
+            </tr>
+
+            <tr>
+              <td>deploy.scp.passphrase</td>
+
+              <td>Local passphrase for your private key.</td>
+
+              <td></td>
+
+              <td>No. You will be prompted if it is not set.</td>
+            </tr>
+
+            <tr>
               <td>deploy.scp.password</td>
 
               <td>Password for user@host</td>
 
               <td></td>
 
-              <td>No. You will be prompted for it if it is not set.</td>
+              <td>No. You will be prompted if it is not set.
+              <br />
+              Not needed if using the preferred
+              deploy.scp.keyfile/deploy.scp.passphrase
+              </td>
             </tr>
           </table>
         </section>

Modified: forrest/trunk/site-author/status.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/site-author/status.xml?rev=381280&r1=381279&r2=381280&view=diff
==============================================================================
--- forrest/trunk/site-author/status.xml (original)
+++ forrest/trunk/site-author/status.xml Sun Feb 26 23:47:30 2006
@@ -130,7 +130,12 @@
         Added document to facilitate
         <link href="site:v0.80//upgrading_08">upgrading to v0.8</link>
       </action>
-      
+
+      <action context="code" type="update" dev="DC" fix-for="FOR-818">
+        Forrestbot deploy.scp workstage now uses keyfile/passphrase in preference,
+        then fallback to remote password.
+      </action>
+
       <action dev="TS" type="add" context="code"> New protocol / source factory 
         that is contacting the locationmap module to look up the source. Use it 
         like lm://resolve.contract.html.content-main for source resolving. 
@@ -286,6 +291,10 @@
 <!-- Please keep this action at the top -->
         Added document to facilitate
         <link href="site:v0.70//upgrading_07">upgrading to v0.7</link>
+      </action>
+      <action context="code" type="update" dev="DC" fix-for="FOR-818">
+        Forrestbot deploy.scp workstage now uses keyfile/passphrase in preference,
+        then fallback to remote password.
       </action>
       <action dev="DC" type="update" context="code" importance="high">
         Added new "clean" targets. Doing 'forrest clean-site' will remove

Modified: forrest/trunk/tools/forrestbot/core/deploy.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/tools/forrestbot/core/deploy.xml?rev=381280&r1=381279&r2=381280&view=diff
==============================================================================
--- forrest/trunk/tools/forrestbot/core/deploy.xml (original)
+++ forrest/trunk/tools/forrestbot/core/deploy.xml Sun Feb 26 23:47:30 2006
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2005 The Apache Software Foundation or its licensors,
+  Copyright 2004-2006 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,6 +17,9 @@
 -->
 <project name="deploy">
 
+  <!-- ================================================================= -->
+  <!-- The deploy.local target                                           -->
+  <!-- ================================================================= -->
   <property name="deploy.local.dir" location="sites/${ant.project.name}"/>
 
   <target name="deploy.local" unless="build.failed" description="FB: Deploy to a local
location">
@@ -34,7 +37,6 @@
   <!-- ================================================================= -->
   <!-- The deploy.ftp target                                             -->
   <!-- ================================================================= -->
-  <!-- properties for deploy.ftp -->
   <property name="deploy.ftp.server" value="localhost"/>
   <property name="deploy.ftp.user" value="anonymous"/>
   <property name="deploy.ftp.password" value="forrestbot@"/>
@@ -53,21 +55,51 @@
       </fileset>
     </ftp>
   </target>
-  <!-- ================================================================= -->
 
+  <!-- ================================================================= -->
+  <!-- The deploy.scp target                                             -->
+  <!-- ================================================================= -->
   <property name="deploy.scp.dest" value=""/>
   <target name="deploy.scp" unless="build.failed" description="FB: Deploy to a remote
location via scp">
     <if>
+      <isset property="deploy.scp.keyfile"/>
+      <then>
+        <antcall target="deploy.scp-with-keyfile"/>
+      </then>
+      <else>
+        <antcall target="deploy.scp-with-password"/>
+      </else>
+    </if>
+  </target>
+  <target name="deploy.scp-with-keyfile">
+    <if>
+      <not><isset property="deploy.scp.passphrase"/></not>
+      <then>
+        <input addproperty="deploy.scp.passphrase"
+            message="Enter local passphrase for key to enable scp to ${deploy.scp.dest}:"/>
+      </then>
+    </if>
+    <scp todir="${deploy.scp.dest}"
+        keyfile="${deploy.scp.keyfile}" passphrase="${deploy.scp.passphrase}">
+      <fileset dir="${build.site-dir}"/>
+    </scp>
+  </target>
+  <target name="deploy.scp-with-password">
+    <if>
       <not><isset property="deploy.scp.password"/></not>
       <then>
-        <input addproperty="deploy.scp.password" message="Enter password for scp to ${deploy.scp.dest}:"/>
+        <input addproperty="deploy.scp.password"
+            message="Enter remote password to enable scp to ${deploy.scp.dest}:"/>
       </then>
     </if>
     <scp todir="${deploy.scp.dest}" password="${deploy.scp.password}">
-     <fileset dir="${build.site-dir}"/>
+      <fileset dir="${build.site-dir}"/>
     </scp>
   </target>
-  
+
+  <!-- ================================================================= -->
+  <!-- The deploy.cvs target                                             -->
+  <!-- ================================================================= -->
   <property name="deploy.cvs.user" value="anoncvs"/>
   <property name="deploy.cvs.password" value="anoncvs"/>
   <property name="deploy.cvs.root" value="/home/cvs"/>
@@ -106,7 +138,9 @@
     </exec>
   </target>
 
-
+  <!-- ================================================================= -->
+  <!-- The deploy.svn target                                             -->
+  <!-- ================================================================= -->
   <property name="deploy.svn.user" value=""/>
   <property name="deploy.svn.password" value=""/>
   <property name="deploy.svn.url" value=""/>
@@ -129,7 +163,7 @@
       <fileset dir="${build.site-dir}"/>
     </copy>
     
-    <!-- add new files to CVS -->
+    <!-- add new files to SVN -->
     <!-- svnadd doesn't work (it doesn't change the working directory properly) -->
     <exec executable="svn" dir="${deploy.svn.svn-dir}" output="${deploy.svn.svn-filestoadd}"
failonerror="true">
       <arg value="status"/>



Mime
View raw message