packaging 0.99.76 → 0.99.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -128,7 +128,7 @@ describe "#Pkg::Repo" do
128
128
  end
129
129
 
130
130
  it 'should execute command if optional params are nil' do
131
- expect(Pkg::Util::Net).to receive(:remote_ssh_cmd).with(remote_host, "some command with #{repo_name} and #{repo_path} and stuff")
131
+ expect(Pkg::Util::Net).to receive(:remote_execute).with(remote_host, "some command with #{repo_name} and #{repo_path} and stuff")
132
132
  Pkg::Repo.update_repo(remote_host, repo_command, { :repo_name => repo_name, :repo_path => repo_path })
133
133
  end
134
134
  end
@@ -7,11 +7,12 @@ describe 'Pkg::Retrieve' do
7
7
  remote_target = 'repos'
8
8
  project = 'puppet-agent'
9
9
  ref = 'b25e64984dd505391f248fe5501ad81e2645b6d2'
10
- foss_platforms = ['el-7-x86_64', 'ubuntu-16.04-amd64', 'osx-10.11-x86_64', 'windows-2012-x64']
10
+ foss_platforms = ['el-7-x86_64', 'ubuntu-16.04-amd64', 'osx-10.15-x86_64', 'osx-11-x86_64', 'windows-2012-x64']
11
11
  platform_data = {:platform_data => {
12
- 'aix-6.1-power' => {:artifact => './aix/6.1/PC1/ppc/puppet-agent-5.3.2.155.gb25e649-1.aix6.1.ppc.rpm'},
12
+ 'aix-7.1-power' => {:artifact => './aix/7.1/PC1/ppc/puppet-agent-5.3.2.155.gb25e649-1.aix7.1.ppc.rpm'},
13
13
  'el-7-x86_64' => {:artifact => './el/7/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.el7.x86_64.rpm'},
14
- 'osx-10.11-x86_64' => {:artifact => './apple/10.11/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.osx10.11.dmg'},
14
+ 'osx-10.15-x86_64' => {:artifact => './apple/10.15/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.osx10.15.dmg'},
15
+ 'osx-11-x86_64' => {:artifact => './apple/11/PC1/x86_64/puppet-agent-5.3.2.155.gb25e649-1.osx11.dmg'},
15
16
  'sles-11-i386' => {:artifact => './sles/11/PC1/i386/puppet-agent-5.3.2.155.gb25e649-1.sles11.i386.rpm'},
16
17
  'solaris-10-sparc' => {:artifact => './solaris/10/PC1/puppet-agent-5.3.2.155.gb25e649-1.sparc.pkg.gz'},
17
18
  'ubuntu-16.04-amd64' => {:artifact => './deb/xenial/PC1/puppet-agent_5.3.2.155.gb25e649-1xenial_amd64.deb'},
@@ -102,10 +102,10 @@ describe "Pkg::Rpm::Repo" do
102
102
  Pkg::Repo.should_receive(:directories_that_contain_packages).and_return(pkg_directories)
103
103
  Pkg::Repo.should_receive(:populate_repo_directory)
104
104
  Pkg::Rpm::Repo.should_receive(:repo_creation_command).and_return(command)
105
- Pkg::Util::Net.should_receive(:remote_ssh_cmd).with(Pkg::Config.distribution_server, command)
105
+ Pkg::Util::Net.should_receive(:remote_execute).with(Pkg::Config.distribution_server, command)
106
106
  Pkg::Rpm::Repo.should_receive(:generate_repo_configs)
107
107
  Pkg::Rpm::Repo.should_receive(:ship_repo_configs)
108
- Pkg::Util::Net.should_receive(:remote_ssh_cmd).with(Pkg::Config.distribution_server, "rm -f #{artifact_directory}/repos/.lock" )
108
+ Pkg::Util::Net.should_receive(:remote_execute).with(Pkg::Config.distribution_server, "rm -f #{artifact_directory}/repos/.lock" )
109
109
  Pkg::Rpm::Repo.create_remote_repos
110
110
  end
111
111
  end
@@ -125,7 +125,7 @@ describe "Pkg::Rpm::Repo" do
125
125
  repo_dir = "#{Pkg::Config.jenkins_repo_path}/#{Pkg::Config.project}/#{Pkg::Config.ref}/repo_configs/rpm"
126
126
  Pkg::Util::File.should_receive(:empty_dir?).with("pkg/repo_configs/rpm").and_return(false)
127
127
  Pkg::Util::RakeUtils.should_receive(:invoke_task).with("pl:fetch")
128
- Pkg::Util::Net.should_receive(:remote_ssh_cmd).with(Pkg::Config.distribution_server, "mkdir -p #{repo_dir}")
128
+ Pkg::Util::Net.should_receive(:remote_execute).with(Pkg::Config.distribution_server, "mkdir -p #{repo_dir}")
129
129
  Pkg::Util::Execution.should_receive(:retry_on_fail).with(:times => 3)
130
130
  Pkg::Rpm::Repo.ship_repo_configs
131
131
  end
@@ -65,7 +65,6 @@ DOC
65
65
  describe '#sign_all' do
66
66
  let(:rpm_directory) { 'foo' }
67
67
  let(:rpms_not_to_sign) { [
68
- "#{rpm_directory}/aix/6.1/PC1/ppc/puppet-agent-5.5.3-1.aix6.1.ppc.rpm",
69
68
  "#{rpm_directory}/aix/7.1/PC1/ppc/puppet-agent-5.5.3-1.aix7.1.ppc.rpm",
70
69
  ] }
71
70
  let(:v3_rpms) { [
@@ -77,7 +76,6 @@ DOC
77
76
  ] }
78
77
  let(:rpms) { rpms_not_to_sign + v3_rpms + v4_rpms }
79
78
  let(:already_signed_rpms) { [
80
- "#{rpm_directory}/cisco-wrlinux/7/PC1/x86_64/puppet-agent-5.5.3-1.cisco_wrlinux7.x86_64.rpm",
81
79
  "#{rpm_directory}/el/6/PC1/x86_64/puppet-agent-5.5.3-1.el6.x86_64.rpm",
82
80
  ] }
83
81
  let(:noarch_rpms) { [
@@ -54,24 +54,35 @@ describe "Pkg::Util::Net" do
54
54
  end
55
55
 
56
56
  describe "remote_ssh_cmd" do
57
+ it "should be able to call via deprecated shim" do
58
+ Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
59
+ Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;bar'")
60
+ Pkg::Util::Execution.should_receive(:success?).and_return(true)
61
+ Pkg::Util::Net.remote_ssh_cmd("foo", "bar", true)
62
+ end
63
+ end
64
+
65
+ describe "remote_execute" do
57
66
  it "should fail if ssh is not present" do
58
67
  Pkg::Util::Tool.stub(:find_tool).with("ssh") { fail }
59
68
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_raise(RuntimeError)
60
- expect{ Pkg::Util::Net.remote_ssh_cmd("foo", "bar") }.to raise_error(RuntimeError)
69
+ expect{ Pkg::Util::Net.remote_execute("foo", "bar") }.to raise_error(RuntimeError)
61
70
  end
62
71
 
63
72
  it "should be able to not fail fast" do
64
73
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
65
74
  Kernel.should_receive(:system).with("#{ssh} -t foo 'bar'")
66
75
  Pkg::Util::Execution.should_receive(:success?).and_return(true)
67
- Pkg::Util::Net.remote_ssh_cmd("foo", "bar", false, '', false)
76
+ Pkg::Util::Net.remote_execute(
77
+ "foo", "bar", capture_output: false, extra_options: '', fail_fast: false)
68
78
  end
69
79
 
70
80
  it "should be able to trace output" do
71
81
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
72
82
  Kernel.should_receive(:system).with("#{ssh} -t foo 'set -x;bar'")
73
83
  Pkg::Util::Execution.should_receive(:success?).and_return(true)
74
- Pkg::Util::Net.remote_ssh_cmd("foo", "bar", false, '', false, true)
84
+ Pkg::Util::Net.remote_execute(
85
+ "foo", "bar", capture_output: false, fail_fast: false, trace: true)
75
86
  end
76
87
 
77
88
  context "without output captured" do
@@ -79,21 +90,22 @@ describe "Pkg::Util::Net" do
79
90
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
80
91
  Kernel.should_receive(:system).with("#{ssh} -t foo 'set -e;bar'")
81
92
  Pkg::Util::Execution.should_receive(:success?).and_return(true)
82
- Pkg::Util::Net.remote_ssh_cmd("foo", "bar")
93
+ Pkg::Util::Net.remote_execute("foo", "bar")
83
94
  end
84
95
 
85
96
  it "should escape single quotes in the command" do
86
97
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
87
98
  Kernel.should_receive(:system).with("#{ssh} -t foo 'set -e;b'\\''ar'")
88
99
  Pkg::Util::Execution.should_receive(:success?).and_return(true)
89
- Pkg::Util::Net.remote_ssh_cmd("foo", "b'ar")
100
+ Pkg::Util::Net.remote_execute("foo", "b'ar")
90
101
  end
91
102
 
92
103
  it "should raise an error if ssh fails" do
93
104
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
94
105
  Kernel.should_receive(:system).with("#{ssh} -t foo 'set -e;bar'")
95
106
  Pkg::Util::Execution.should_receive(:success?).and_return(false)
96
- expect{ Pkg::Util::Net.remote_ssh_cmd("foo", "bar") }.to raise_error(RuntimeError, /Remote ssh command failed./)
107
+ expect{ Pkg::Util::Net.remote_execute("foo", "bar") }
108
+ .to raise_error(RuntimeError, /failed./)
97
109
  end
98
110
  end
99
111
 
@@ -102,21 +114,22 @@ describe "Pkg::Util::Net" do
102
114
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
103
115
  Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;bar'")
104
116
  Pkg::Util::Execution.should_receive(:success?).and_return(true)
105
- Pkg::Util::Net.remote_ssh_cmd("foo", "bar", true)
117
+ Pkg::Util::Net.remote_execute("foo", "bar", capture_output: true)
106
118
  end
107
119
 
108
120
  it "should escape single quotes in the command" do
109
121
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
110
122
  Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;b'\\''ar'")
111
123
  Pkg::Util::Execution.should_receive(:success?).and_return(true)
112
- Pkg::Util::Net.remote_ssh_cmd("foo", "b'ar", true)
124
+ Pkg::Util::Net.remote_execute("foo", "b'ar", capture_output: true)
113
125
  end
114
126
 
115
127
  it "should raise an error if ssh fails" do
116
128
  Pkg::Util::Tool.should_receive(:check_tool).with("ssh").and_return(ssh)
117
129
  Pkg::Util::Execution.should_receive(:capture3).with("#{ssh} -t foo 'set -e;bar'")
118
130
  Pkg::Util::Execution.should_receive(:success?).and_return(false)
119
- expect{ Pkg::Util::Net.remote_ssh_cmd("foo", "bar", true) }.to raise_error(RuntimeError, /Remote ssh command failed./)
131
+ expect{ Pkg::Util::Net.remote_execute("foo", "bar", capture_output: true) }
132
+ .to raise_error(RuntimeError, /failed./)
120
133
  end
121
134
  end
122
135
  end
@@ -126,7 +126,7 @@ describe '#Pkg::Util::Ship' do
126
126
  # All of these expects must be called in the same block in order for the
127
127
  # tests to work without actually shipping anything
128
128
  expect(Pkg::Util::Net)
129
- .to receive(:remote_ssh_cmd)
129
+ .to receive(:remote_execute)
130
130
  .with(test_staging_server, /#{test_remote_path}/)
131
131
  .exactly(retrieved_packages.count).times
132
132
  expect(Pkg::Util::Net)
@@ -167,7 +167,7 @@ describe '#Pkg::Util::Ship' do
167
167
  # All of these expects must be called in the same block in order for the
168
168
  # tests to work without actually shipping anything
169
169
  expect(Pkg::Util::Net)
170
- .to receive(:remote_ssh_cmd)
170
+ .to receive(:remote_execute)
171
171
  .with(test_staging_server, /#{test_remote_path}/)
172
172
  expect(Pkg::Util::Net)
173
173
  .to receive(:rsync_to)
data/tasks/archive.rake CHANGED
@@ -39,7 +39,7 @@ namespace :pl do
39
39
  task :deploy_staged_apt_archives_to_s3 => 'pl:fetch' do
40
40
  command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com/apt'
41
41
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
42
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
42
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
43
43
  end
44
44
  end
45
45
 
@@ -47,7 +47,7 @@ namespace :pl do
47
47
  task :deploy_staged_yum_archives_to_s3 => 'pl:fetch' do
48
48
  command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com/yum'
49
49
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
50
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
50
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
51
51
  end
52
52
  end
53
53
 
@@ -55,7 +55,7 @@ namespace :pl do
55
55
  task :deploy_staged_downloads_archives_to_s3 => 'pl:fetch' do
56
56
  command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com/downloads'
57
57
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
58
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
58
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
59
59
  end
60
60
  end
61
61
 
@@ -67,4 +67,3 @@ namespace :pl do
67
67
  end
68
68
  end
69
69
  end
70
-
data/tasks/education.rake CHANGED
@@ -35,7 +35,7 @@ namespace :pl do
35
35
  end
36
36
 
37
37
  # If the archive directory exists, move old VMs to it
38
- Pkg::Util::Net.remote_ssh_cmd(target_host, "if [ -d #{target_directory}/archive ]; then #{archive_cmd}; fi")
38
+ Pkg::Util::Net.remote_execute(target_host, "if [ -d #{target_directory}/archive ]; then #{archive_cmd}; fi")
39
39
 
40
40
  # Ship VM and md5 to host
41
41
  Pkg::Util::Net.rsync_to(vm, target_host, target_directory)
@@ -45,10 +45,10 @@ namespace :pl do
45
45
  link_target.each do |link|
46
46
  link_path = File.join(target_directory, link)
47
47
  link_md5_path = "#{link_path}.md5"
48
- Pkg::Util::Net.remote_ssh_cmd(target_host, "if [[ -L '#{link_path}' ]] && [[ ! -e '#{link_path}' ]] ; then echo '#{link_path} is a broken link, deleting' ; unlink '#{link_path}' ; fi")
49
- Pkg::Util::Net.remote_ssh_cmd(target_host, "if [[ -L '#{link_md5_path}' ]] && [[ ! -e '#{link_md5_path}' ]] ; then echo '#{link_md5_path} is a broken link, deleting' ; unlink '#{link_md5_path}' ; fi")
50
- Pkg::Util::Net.remote_ssh_cmd(target_host, "cd #{target_directory} ; ln -sf #{File.basename(vm)} #{link}")
51
- Pkg::Util::Net.remote_ssh_cmd(target_host, "cd #{target_directory} ; ln -sf #{File.basename(md5)} #{link}.md5")
48
+ Pkg::Util::Net.remote_execute(target_host, "if [[ -L '#{link_path}' ]] && [[ ! -e '#{link_path}' ]] ; then echo '#{link_path} is a broken link, deleting' ; unlink '#{link_path}' ; fi")
49
+ Pkg::Util::Net.remote_execute(target_host, "if [[ -L '#{link_md5_path}' ]] && [[ ! -e '#{link_md5_path}' ]] ; then echo '#{link_md5_path} is a broken link, deleting' ; unlink '#{link_md5_path}' ; fi")
50
+ Pkg::Util::Net.remote_execute(target_host, "cd #{target_directory} ; ln -sf #{File.basename(vm)} #{link}")
51
+ Pkg::Util::Net.remote_execute(target_host, "cd #{target_directory} ; ln -sf #{File.basename(md5)} #{link}.md5")
52
52
  end
53
53
 
54
54
  puts "'#{vm}' and '#{md5}' have been shipped via rsync to '#{target_host}/#{target_directory}'"
data/tasks/gem.rake CHANGED
@@ -39,23 +39,24 @@ end
39
39
 
40
40
  def create_default_gem_spec
41
41
  spec = Gem::Specification.new do |s|
42
- s.name = Pkg::Config.project unless Pkg::Config.project.nil?
43
- s.name = Pkg::Config.gem_name unless Pkg::Config.gem_name.nil?
44
- s.version = Pkg::Config.gemversion unless Pkg::Config.gemversion.nil?
45
- s.author = Pkg::Config.author unless Pkg::Config.author.nil?
46
- s.email = Pkg::Config.email unless Pkg::Config.email.nil?
47
- s.homepage = Pkg::Config.homepage unless Pkg::Config.homepage.nil?
48
- s.summary = Pkg::Config.summary unless Pkg::Config.summary.nil?
49
- s.summary = Pkg::Config.gem_summary unless Pkg::Config.gem_summary.nil?
50
- s.description = Pkg::Config.description unless Pkg::Config.description.nil?
51
- s.description = Pkg::Config.gem_description unless Pkg::Config.gem_description.nil?
52
- s.files = glob_gem_files unless glob_gem_files.nil?
53
- s.executables = Pkg::Config.gem_executables unless Pkg::Config.gem_executables.nil?
54
- s.require_path = Pkg::Config.gem_require_path unless Pkg::Config.gem_require_path.nil?
55
- s.required_ruby_version = Pkg::Config.gem_required_ruby_version unless Pkg::Config.gem_required_ruby_version.nil?
42
+ s.name = Pkg::Config.project unless Pkg::Config.project.nil?
43
+ s.name = Pkg::Config.gem_name unless Pkg::Config.gem_name.nil?
44
+ s.version = Pkg::Config.gemversion unless Pkg::Config.gemversion.nil?
45
+ s.author = Pkg::Config.author unless Pkg::Config.author.nil?
46
+ s.email = Pkg::Config.email unless Pkg::Config.email.nil?
47
+ s.homepage = Pkg::Config.homepage unless Pkg::Config.homepage.nil?
48
+ s.summary = Pkg::Config.summary unless Pkg::Config.summary.nil?
49
+ s.summary = Pkg::Config.gem_summary unless Pkg::Config.gem_summary.nil?
50
+ s.description = Pkg::Config.description unless Pkg::Config.description.nil?
51
+ s.description = Pkg::Config.gem_description unless Pkg::Config.gem_description.nil?
52
+ s.files = glob_gem_files unless glob_gem_files.nil?
53
+ s.executables = Pkg::Config.gem_executables unless Pkg::Config.gem_executables.nil?
54
+ s.require_path = Pkg::Config.gem_require_path unless Pkg::Config.gem_require_path.nil?
55
+ s.required_ruby_version = Pkg::Config.gem_required_ruby_version unless Pkg::Config.gem_required_ruby_version.nil?
56
56
  s.required_rubygems_version = Pkg::Config.gem_required_rubygems_version unless Pkg::Config.gem_required_rubygems_version.nil?
57
- s.test_files = FileList[Pkg::Config.gem_test_files.split(' ')] unless Pkg::Config.gem_test_files.nil?
58
- s.rubyforge_project = Pkg::Config.gem_forge_project unless Pkg::Config.gem_forge_project.nil?
57
+ s.test_files = FileList[Pkg::Config.gem_test_files.split(' ')] unless Pkg::Config.gem_test_files.nil?
58
+ s.license = Pkg::Config.gem_license unless Pkg::Config.gem_license.nil?
59
+ s.rubyforge_project = Pkg::Config.gem_forge_project unless Pkg::Config.gem_forge_project.nil?
59
60
  Pkg::Config.gem_rdoc_options.each do |option|
60
61
  s.rdoc_options << option
61
62
  end unless Pkg::Config.gem_rdoc_options.nil?
@@ -26,10 +26,10 @@ cd #{remote_repo} ;
26
26
  #{Pkg::Util::Net.remote_bundle_install_command}
27
27
  bundle exec rake pl:jenkins:sign_repos GPG_KEY=#{Pkg::Util::Gpg.key} PARAMS_FILE=#{build_params}
28
28
  DOC
29
- Pkg::Util::Net.remote_ssh_cmd(signing_server, rake_command)
29
+ Pkg::Util::Net.remote_execute(signing_server, rake_command)
30
30
  Pkg::Util::Net.rsync_from("#{remote_repo}/repos/", signing_server, target)
31
- Pkg::Util::Net.remote_ssh_cmd(signing_server, "rm -rf #{remote_repo}")
32
- Pkg::Util::Net.remote_ssh_cmd(signing_server, "rm #{build_params}")
31
+ Pkg::Util::Net.remote_execute(signing_server, "rm -rf #{remote_repo}")
32
+ Pkg::Util::Net.remote_execute(signing_server, "rm #{build_params}")
33
33
  puts "Signed packages staged in '#{target}' directory"
34
34
  end
35
35
 
@@ -48,7 +48,7 @@ DOC
48
48
  target_dir = "#{Pkg::Config.jenkins_repo_path}/#{Pkg::Config.project}/#{Pkg::Config.ref}/#{target_prefix}_repos"
49
49
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
50
50
  # Ship the now signed repos to the distribution server
51
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.distribution_server, "mkdir -p #{target_dir}")
51
+ Pkg::Util::Net.remote_execute(Pkg::Config.distribution_server, "mkdir -p #{target_dir}")
52
52
  Pkg::Util::Net.rsync_to("#{target_prefix}_repos/", Pkg::Config.distribution_server, target_dir)
53
53
  end
54
54
  end
@@ -244,11 +244,11 @@ DOC
244
244
  local_pa_latest = "#{pa_source}-latest"
245
245
  local_pe_latest = "#{pe_target}-latest"
246
246
 
247
- Pkg::Util::Net.remote_ssh_cmd(target_host, "mkdir -p '#{pe_target}'")
248
- Pkg::Util::Net.remote_ssh_cmd(target_host, "mkdir -p '#{local_pe_latest}'")
249
- Pkg::Util::Net.remote_ssh_cmd(target_host, "cp -r #{local_pa_latest}/* #{local_pe_latest}")
250
- Pkg::Util::Net.remote_ssh_cmd(target_host, "sed -i 's|/#{File.basename(local_pa_latest)}|/#{pe_version}/#{File.basename(local_pa_latest)}|' #{local_pe_latest}/repo_configs/*/*")
251
- Pkg::Util::Net.remote_ssh_cmd(target_host, "ln -sf '#{local_pa}' '#{local_pe}'")
247
+ Pkg::Util::Net.remote_execute(target_host, "mkdir -p '#{pe_target}'")
248
+ Pkg::Util::Net.remote_execute(target_host, "mkdir -p '#{local_pe_latest}'")
249
+ Pkg::Util::Net.remote_execute(target_host, "cp -r #{local_pa_latest}/* #{local_pe_latest}")
250
+ Pkg::Util::Net.remote_execute(target_host, "sed -i 's|/#{File.basename(local_pa_latest)}|/#{pe_version}/#{File.basename(local_pa_latest)}|' #{local_pe_latest}/repo_configs/*/*")
251
+ Pkg::Util::Net.remote_execute(target_host, "ln -sf '#{local_pa}' '#{local_pe}'")
252
252
  end
253
253
 
254
254
  task :nightly_repos => ["pl:fetch"] do
data/tasks/pe_ship.rake CHANGED
@@ -65,7 +65,7 @@ if Pkg::Config.build_pe
65
65
  puts "Shipping PE debs to apt repo 'incoming' dir on #{Pkg::Config.apt_host}"
66
66
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
67
67
  Dir["pkg/pe/deb/#{dist}/*.deb"].each do |deb|
68
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.apt_host, "mkdir -p '#{target_path}/#{dist}'")
68
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_host, "mkdir -p '#{target_path}/#{dist}'")
69
69
  Pkg::Util::Net.rsync_to(deb, Pkg::Config.apt_host, "#{target_path}/#{dist}/#{File.basename(deb)}")
70
70
  end
71
71
  end
@@ -145,23 +145,11 @@ if Pkg::Config.build_pe
145
145
  # single line. By breaking it into a series of concatenated strings, we can maintain
146
146
  # a semblance of formatting and structure (nevermind readability).
147
147
  command = %(for dir in #{repo_base_path}/{#{rpm_family_and_version.join(",")}}-*; do)
148
-
149
- # For (RE-12463), make this less quiet than it has been.
150
- # We're trying to find out why its aborting. Preserve the original
151
- # so it can be restored.
152
- command += %( sudo createrepo --checksum=sha --checkts --update --delta-workers=0 --database --update $dir; )
153
-
154
- ## Original
155
- # command += %( sudo createrepo --checksum=sha --checkts --update --delta-workers=0 --quiet --database --update $dir; )
156
- ##
148
+ command += %( sudo createrepo --checksum=sha --checkts --update --delta-workers=0 --quiet --database --update $dir; )
157
149
  command += %(done; )
158
150
  command += %(sync)
159
151
 
160
- # Again for (RE-12463). Make this more verbose temporarily
161
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.yum_host, command, false, '', true, true)
162
-
163
- ## Original one below
164
- # Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.yum_host, command)
152
+ Pkg::Util::Net.remote_execute(Pkg::Config.yum_host, command)
165
153
  end
166
154
 
167
155
  desc "Remotely add shipped packages to apt repo on #{Pkg::Config.apt_host}"
@@ -183,7 +171,11 @@ if Pkg::Config.build_pe
183
171
  aptly publish repo -gpg-key=\"8BBEB79B\" #{Pkg::Config::pe_version}-#{dist} #{Pkg::Config::pe_version}
184
172
  fi
185
173
  eos
186
- stdout, stderr = Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.apt_host, cmd, true)
174
+ stdout, stderr = Pkg::Util::Net.remote_execute(
175
+ Pkg::Config.apt_host,
176
+ cmd,
177
+ { capture_output: true }
178
+ )
187
179
 
188
180
  output = stdout.to_s + stderr.to_s
189
181
 
@@ -197,7 +189,7 @@ if Pkg::Config.build_pe
197
189
  puts
198
190
 
199
191
  puts "Cleaning up apt repo 'incoming' dir on #{Pkg::Config.apt_host}"
200
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.apt_host, "rm -r #{incoming_dir}")
192
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_host, "rm -r #{incoming_dir}")
201
193
 
202
194
  end
203
195
 
@@ -213,7 +205,7 @@ if Pkg::Config.build_pe
213
205
  command += %(done; )
214
206
  command += %(sync)
215
207
 
216
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.yum_host, command)
208
+ Pkg::Util::Net.remote_execute(Pkg::Config.yum_host, command)
217
209
  end
218
210
 
219
211
  desc "Remotely link shipped deb packages into feature repo on #{Pkg::Config.apt_host}"
@@ -227,7 +219,7 @@ if Pkg::Config.build_pe
227
219
  command += %(done; )
228
220
  command += %(sync)
229
221
 
230
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.apt_host, command)
222
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_host, command)
231
223
  end
232
224
  end
233
225
  end
data/tasks/ship.rake CHANGED
@@ -83,7 +83,11 @@ namespace :pl do
83
83
  source_dir = 'pkg/solaris/11/'
84
84
  end
85
85
 
86
- tmpdir, _ = Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.ips_host, 'mktemp -d -p /var/tmp', true)
86
+ tmpdir, _ = Pkg::Util::Net.remote_execute(
87
+ Pkg::Config.ips_host,
88
+ 'mktemp -d -p /var/tmp',
89
+ { capture_output: true }
90
+ )
87
91
  tmpdir.chomp!
88
92
 
89
93
  Pkg::Util::Net.rsync_to(source_dir, Pkg::Config.ips_host, tmpdir)
@@ -92,9 +96,9 @@ namespace :pl do
92
96
  sudo pkgrecv -s $pkg -d #{Pkg::Config.ips_path} '*';
93
97
  done)
94
98
 
95
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.ips_host, remote_cmd)
96
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.ips_host, "sudo pkgrepo refresh -s #{Pkg::Config.ips_path}")
97
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.ips_host, "sudo /usr/sbin/svcadm restart svc:/application/pkg/server:#{Pkg::Config.ips_repo || 'default'}")
99
+ Pkg::Util::Net.remote_execute(Pkg::Config.ips_host, remote_cmd)
100
+ Pkg::Util::Net.remote_execute(Pkg::Config.ips_host, "sudo pkgrepo refresh -s #{Pkg::Config.ips_path}")
101
+ Pkg::Util::Net.remote_execute(Pkg::Config.ips_host, "sudo /usr/sbin/svcadm restart svc:/application/pkg/server:#{Pkg::Config.ips_repo || 'default'}")
98
102
  end
99
103
  end
100
104
 
@@ -104,7 +108,7 @@ namespace :pl do
104
108
  if Pkg::Util.ask_yes_or_no
105
109
  Pkg::Util::Execution.retry_on_fail(times: 3) do
106
110
  cmd = Pkg::Util::Net.rsync_cmd(Pkg::Config.dmg_path, target_host: Pkg::Config.dmg_host, extra_flags: ['--update'])
107
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.dmg_staging_server, cmd)
111
+ Pkg::Util::Net.remote_execute(Pkg::Config.dmg_staging_server, cmd)
108
112
  end
109
113
  end
110
114
  end
@@ -115,7 +119,7 @@ namespace :pl do
115
119
  if Pkg::Util.ask_yes_or_no
116
120
  Pkg::Util::Execution.retry_on_fail(times: 3) do
117
121
  cmd = Pkg::Util::Net.rsync_cmd(Pkg::Config.swix_path, target_host: Pkg::Config.swix_host, extra_flags: ['--update'])
118
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.swix_staging_server, cmd)
122
+ Pkg::Util::Net.remote_execute(Pkg::Config.swix_staging_server, cmd)
119
123
  end
120
124
  end
121
125
  end
@@ -130,7 +134,7 @@ namespace :pl do
130
134
  else
131
135
  Pkg::Util::Execution.retry_on_fail(times: 3) do
132
136
  cmd = Pkg::Util::Net.rsync_cmd(Pkg::Config.tarball_path, target_host: Pkg::Config.tar_host, extra_flags: ['--update'])
133
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.tar_staging_server, cmd)
137
+ Pkg::Util::Net.remote_execute(Pkg::Config.tar_staging_server, cmd)
134
138
  end
135
139
  end
136
140
  end
@@ -146,7 +150,7 @@ namespace :pl do
146
150
  else
147
151
  Pkg::Util::Execution.retry_on_fail(times: 3) do
148
152
  cmd = Pkg::Util::Net.rsync_cmd(Pkg::Config.msi_path, target_host: Pkg::Config.msi_host, extra_flags: ['--update'])
149
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.msi_staging_server, cmd)
153
+ Pkg::Util::Net.remote_execute(Pkg::Config.msi_staging_server, cmd)
150
154
  end
151
155
  end
152
156
  end
@@ -174,7 +178,7 @@ namespace :pl do
174
178
  if Pkg::Util.ask_yes_or_no
175
179
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
176
180
  command = 'sudo /usr/local/bin/s3_repo_sync.sh apt.puppetlabs.com'
177
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.apt_signing_server, command)
181
+ Pkg::Util::Net.remote_execute(Pkg::Config.apt_signing_server, command)
178
182
  end
179
183
  end
180
184
  end
@@ -200,7 +204,7 @@ namespace :pl do
200
204
  if Pkg::Util.ask_yes_or_no
201
205
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
202
206
  command = 'sudo /usr/local/bin/s3_repo_sync.sh yum.puppetlabs.com'
203
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.yum_staging_server, command)
207
+ Pkg::Util::Net.remote_execute(Pkg::Config.yum_staging_server, command)
204
208
  end
205
209
  end
206
210
  end
@@ -211,7 +215,7 @@ namespace :pl do
211
215
  if Pkg::Util.ask_yes_or_no
212
216
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
213
217
  command = 'sudo /usr/local/bin/s3_repo_sync.sh downloads.puppetlabs.com'
214
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
218
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
215
219
  end
216
220
  end
217
221
  end
@@ -228,7 +232,7 @@ namespace :pl do
228
232
  puts "Deploying nightly builds from #{Pkg::Config.staging_server} to AWS S3..."
229
233
  Pkg::Util::Execution.retry_on_fail(:times => 3) do
230
234
  command = 'sudo /usr/local/bin/s3_repo_sync.sh nightlies.puppet.com'
231
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
235
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
232
236
  end
233
237
  end
234
238
 
@@ -242,7 +246,7 @@ namespace :pl do
242
246
  ['apt', 'yum'].each do |repo|
243
247
  # Don't --delete so that folks using archived packages can continue to do so
244
248
  command = "sudo su - rsync --command 'rsync --verbose -a --exclude '*.html' /opt/repo-s3-stage/repositories/#{repo}.puppetlabs.com/ rsync@#{rsync_server}:/opt/repository/#{repo}'"
245
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
249
+ Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)
246
250
  end
247
251
  end
248
252
  end
@@ -263,7 +267,7 @@ namespace :pl do
263
267
 
264
268
  command += %(; sync)
265
269
 
266
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.gem_host, command)
270
+ Pkg::Util::Net.remote_execute(Pkg::Config.gem_host, command)
267
271
  end
268
272
  end
269
273
 
@@ -499,7 +503,11 @@ namespace :pl do
499
503
  # Check for ability to sign OSX. Should just need to be able to unlock keychain
500
504
  begin
501
505
  unless ssh_errs.include?(Pkg::Config.osx_signing_server)
502
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.osx_signing_server, %(/usr/bin/security -q unlock-keychain -p "#{Pkg::Config.osx_signing_keychain_pw}" "#{Pkg::Config.osx_signing_keychain}"), false, '-oBatchMode=yes')
506
+ Pkg::Util::Net.remote_execute(
507
+ Pkg::Config.osx_signing_server,
508
+ %(/usr/bin/security -q unlock-keychain -p "#{Pkg::Config.osx_signing_keychain_pw}" "#{Pkg::Config.osx_signing_keychain}"),
509
+ { extra_options: '-oBatchMode=yes' }
510
+ )
503
511
  end
504
512
  rescue
505
513
  errs << "Unlocking the OSX keychain failed! Check the password in your .bashrc on #{Pkg::Config.osx_signing_server}"
@@ -545,7 +553,17 @@ namespace :pl do
545
553
  artifactory = Pkg::ManageArtifactory.new(Pkg::Config.project, Pkg::Config.ref)
546
554
 
547
555
  local_dir = args.local_dir || 'pkg'
548
- Dir.glob("#{local_dir}/**/*").reject { |e| File.directory? e }.each do |artifact|
556
+ artifacts = Dir.glob("#{local_dir}/**/*").reject { |e| File.directory? e }
557
+ artifacts.sort! do |a, b|
558
+ if File.extname(a) =~ /(md5|sha\d+)/ && File.extname(b) !~ /(md5|sha\d+)/
559
+ 1
560
+ elsif File.extname(b) =~ /(md5|sha\d+)/ && File.extname(a) !~ /(md5|sha\d+)/
561
+ -1
562
+ else
563
+ a <=> b
564
+ end
565
+ end
566
+ artifacts.each do |artifact|
549
567
  if File.extname(artifact) == ".yaml" || File.extname(artifact) == ".json"
550
568
  artifactory.deploy_package(artifact)
551
569
  elsif artifactory.package_exists_on_artifactory?(artifact)
@@ -652,8 +670,8 @@ namespace :pl do
652
670
  end
653
671
 
654
672
  Pkg::Util::Execution.retry_on_fail(times: 3) do
655
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.distribution_server, "mkdir --mode=775 -p #{project_basedir}")
656
- Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.distribution_server, "mkdir -p #{artifact_dir}")
673
+ Pkg::Util::Net.remote_execute(Pkg::Config.distribution_server, "mkdir --mode=775 -p #{project_basedir}")
674
+ Pkg::Util::Net.remote_execute(Pkg::Config.distribution_server, "mkdir -p #{artifact_dir}")
657
675
  Pkg::Util::Net.rsync_to("#{local_dir}/", Pkg::Config.distribution_server, "#{artifact_dir}/", extra_flags: ['--ignore-existing', '--exclude repo_configs'])
658
676
  end
659
677