您的位置:首页 > 其它

jenkins publish over ssh配置文件特点

2016-03-24 15:50 323 查看
jenkins插件publish over ssh的配置文件特点:
1,如果没有配置任何的host,则使用默认<commonConfig>
2,如果配置了一个host,则把默认配置放在这个host的配置中
3,如果配置大于一个的host,则从二个起,引用第一个host中的默认配置

ps:此处的默认配置为:无密码登录的私钥位置(自动化部署的测试研发环境)

因为把密钥复制到了jenkins的根目录下,所以这里不用写绝对路径,或者复制key的内容

只配置默认私钥位置

<?xml version='1.0' encoding='UTF-8'?>
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin_-Descriptor plugin="publish-over-ssh@1.13">
<hostConfigurations/>
<commonConfig>
<secretPassphrase>K52tSMwYbmSU0HYqADRewg==</secretPassphrase>
<key></key>
<keyPath>id_rsa</keyPath>
<disableAllExec>false</disableAllExec>
</commonConfig>
<defaults class="jenkins.plugins.publish_over_ssh.options.SshPluginDefaults"/>
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin_-Descriptor>

配置了一个host的配置文件形式

<?xml version='1.0' encoding='UTF-8'?>
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin_-Descriptor plugin="publish-over-ssh@1.13">
<hostConfigurations>
<jenkins.plugins.publish__over__ssh.BapSshHostConfiguration>
<name>192.168.100.227</name>
<hostname>192.168.100.227</hostname>
<username>root</username>
<secretPassword>K52tSMwYbmSU0HYqADRewg==</secretPassword>
<remoteRootDir></remoteRootDir>
<port>22</port>
<commonConfig class="jenkins.plugins.publish_over_ssh.BapSshCommonConfiguration">
<secretPassphrase>K52tSMwYbmSU0HYqADRewg==</secretPassphrase>
<key></key>
<keyPath>id_rsa</keyPath>
<disableAllExec>false</disableAllExec>
</commonConfig>
<timeout>300000</timeout>
<overrideKey>false</overrideKey>
<disableExec>false</disableExec>
<keyInfo>
<secretPassphrase>K52tSMwYbmSU0HYqADRewg==</secretPassphrase>
<key></key>
<keyPath></keyPath>
</keyInfo>
</jenkins.plugins.publish__over__ssh.BapSshHostConfiguration>
</hostConfigurations>
<commonConfig reference="../hostConfigurations/jenkins.plugins.publish__over__ssh.BapSshHostConfiguration/commonConfig"/>
<defaults class="jenkins.plugins.publish_over_ssh.options.SshPluginDefaults"/>
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin_-Descriptor>

配置了两个host的配置文件形式

<?xml version='1.0' encoding='UTF-8'?>
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin_-Descriptor plugin="publish-over-ssh@1.13">
<hostConfigurations>
<jenkins.plugins.publish__over__ssh.BapSshHostConfiguration>
<name>192.168.100.227</name>
<hostname>192.168.100.227</hostname>
<username>root</username>
<secretPassword>K52tSMwYbmSU0HYqADRewg==</secretPassword>
<remoteRootDir></remoteRootDir>
<port>22</port>
<commonConfig class="jenkins.plugins.publish_over_ssh.BapSshCommonConfiguration">
<secretPassphrase>K52tSMwYbmSU0HYqADRewg==</secretPassphrase>
<key></key>
<keyPath>id_rsa</keyPath>
<disableAllExec>false</disableAllExec>
</commonConfig>
<timeout>300000</timeout>
<overrideKey>false</overrideKey>
<disableExec>false</disableExec>
<keyInfo>
<secretPassphrase>K52tSMwYbmSU0HYqADRewg==</secretPassphrase>
<key></key>
<keyPath></keyPath>
</keyInfo>
</jenkins.plugins.publish__over__ssh.BapSshHostConfiguration>
<jenkins.plugins.publish__over__ssh.BapSshHostConfiguration>
<name>192.168.104.157</name>
<hostname>192.168.104.157</hostname>
<username>root</username>
<secretPassword>K52tSMwYbmSU0HYqADRewg==</secretPassword>
<remoteRootDir></remoteRootDir>
<port>22</port>
<commonConfig class="jenkins.plugins.publish_over_ssh.BapSshCommonConfiguration" reference="../../jenkins.plugins.publish__over__ssh.BapSshHostConfiguration/commonConfig"/>
<timeout>300000</timeout>
<overrideKey>false</overrideKey>
<disableExec>false</disableExec>
<keyInfo>
<secretPassphrase>K52tSMwYbmSU0HYqADRewg==</secretPassphrase>
<key></key>
<keyPath></keyPath>
</keyInfo>
</jenkins.plugins.publish__over__ssh.BapSshHostConfiguration>
</hostConfigurations>
<commonConfig reference="../hostConfigurations/jenkins.plugins.publish__over__ssh.BapSshHostConfiguration/commonConfig"/>
<defaults class="jenkins.plugins.publish_over_ssh.options.SshPluginDefaults"/>
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin_-Descriptor>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: