mofa 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mofa/upload_cmd.rb +12 -2
- data/lib/mofa/version.rb +1 -1
- metadata +1 -1
data/lib/mofa/upload_cmd.rb
CHANGED
@@ -47,7 +47,12 @@ class UploadCmd < MofaCmd
|
|
47
47
|
|
48
48
|
# if the upload target is not a proper binrepo with a designated ".../import" folder -> create the "right" folder structure
|
49
49
|
unless Mofa::Config.config['binrepo_import_dir'].match(/import$/)
|
50
|
-
Net::SSH.start(Mofa::Config.config['binrepo_host'],
|
50
|
+
Net::SSH.start(Mofa::Config.config['binrepo_host'],
|
51
|
+
Mofa::Config.config['binrepo_ssh_user'],
|
52
|
+
:keys => [Mofa::Config.config['binrepo_ssh_keyfile']],
|
53
|
+
:port => Mofa::Config.config['binrepo_ssh_port'],
|
54
|
+
:verbose => :error,
|
55
|
+
:use_agent => false) do |ssh|
|
51
56
|
puts "Remotely creating target dir \"#{import_dir}/#{cookbook.name}/#{cookbook.version}\""
|
52
57
|
out = ssh_exec!(ssh, "[ -d #{import_dir}/#{cookbook.name}/#{cookbook.version} ] || mkdir -p #{import_dir}/#{cookbook.name}/#{cookbook.version}")
|
53
58
|
fail "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
@@ -56,7 +61,12 @@ class UploadCmd < MofaCmd
|
|
56
61
|
end
|
57
62
|
|
58
63
|
begin
|
59
|
-
Net::SFTP.start(Mofa::Config.config['binrepo_host'],
|
64
|
+
Net::SFTP.start(Mofa::Config.config['binrepo_host'],
|
65
|
+
Mofa::Config.config['binrepo_ssh_user'],
|
66
|
+
:keys => [Mofa::Config.config['binrepo_ssh_keyfile']],
|
67
|
+
:port => Mofa::Config.config['binrepo_ssh_port'],
|
68
|
+
:verbose => :error,
|
69
|
+
:use_agent => false) do |sftp|
|
60
70
|
sftp.upload!("#{cookbook.pkg_dir}/#{cookbook.pkg_name}", "#{import_dir}/#{cookbook.pkg_name}")
|
61
71
|
end
|
62
72
|
puts "OK."
|
data/lib/mofa/version.rb
CHANGED