wagon ssh corrupts known_hosts?

2014-09-20 Thread Kevin Burton
I have a step release process.

Step 1 uses maven and the wagon-ssh plugin to push .debs and .jars to my
maven and debian repositories via SSH and the scp:// wagon which uses jSch.

Step 2 uses ansible and SSH via OpenSSH… this is the step that breaks now
because jSch writes a new known_hosts file.  SSH then prompts me every time
to accept the new host key.

This is prone to error and I  want to fix it.. I do releases in ‘screen’
and if I forget to come back 5 minutes later to type ‘yes’ for all my hosts
it breaks the release.

Plus I want it automated for obvious reasons.



-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
https://plus.google.com/102718274791889610666/posts
http://spinn3r.com


RE: wagon ssh corrupts known_hosts?

2014-09-20 Thread Martin Gainty



 From: bur...@spinn3r.com
 Date: Sat, 20 Sep 2014 15:38:07 -0700
 Subject: wagon ssh corrupts known_hosts?
 To: users@maven.apache.org
 
 I have a step release process.
 
 Step 1 uses maven and the wagon-ssh plugin to push .debs and .jars to my
 maven and debian repositories via SSH and the scp:// wagon which uses jSch.
 
 Step 2 uses ansible and SSH via OpenSSH… this is the step that breaks now
 because jSch writes a new known_hosts file.  SSH then prompts me every time
 to accept the new host key.
 
 This is prone to error and I  want to fix it.. I do releases in ‘screen’
 and if I forget to come back 5 minutes later to type ‘yes’ for all my hosts
 it breaks the release.
MGhttp://www.programcreek.com/java-api-examples/index.php?api=com.jcraft.jsch.ChannelExec
MGautomate JSch with a response file
try { //assuming local.rsp contains the 'canned answers'
final File localFile = new java.io.File(local.rsp);
// Set input stream from local file
setInputStream(new BufferedInputStream(new 
FileInputStream(localFile)));
final URL url = getRemoteFileURL();

...//later on when you need the response grab it from the 
channel inputStream
responseStream = channel.getInputStream();
channel.connect();
scpUtil.checkAck(responseStream);
sendFileNameAndSize(localFile, targetFileName, outs, 
responseStream);

}
catch(Exception excp)
{

}
 
 Plus I want it automated for obvious reasons. 
MGa response file for Jsch would solve the requirement
 
 
 
 -- 
 
 Founder/CEO Spinn3r.com
 Location: *San Francisco, CA*
 blog: http://burtonator.wordpress.com
 … or check out my Google+ profile
 https://plus.google.com/102718274791889610666/posts
 http://spinn3r.com