11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/packaging/rpm/repo.rb', line 11
def ship_repo_configs(repo_configs_directory = 'repo_configs')
local_repos_path = File.join('pkg', repo_configs_directory, 'rpm')
remote_repos_path = File.join(
Pkg::Config.jenkins_repo_path,
Pkg::Config.project,
Pkg::Config.ref,
repo_configs_directory,
'rpm'
)
if !Dir.exist?(local_repos_path) || Dir.empty?(local_repos_path)
warn "No repo_configs found in \"#{Dir.pwd}/#{local_repos_path}\". " \
'Skipping repo shipping.'
return
end
Pkg::Util::RakeUtils.invoke_task('pl:fetch')
Pkg::Util::Net.remote_execute(
Pkg::Config.distribution_server,
"mkdir -p #{remote_repos_path}"
)
Pkg::Util::Execution.retry_on_fail(times: 3) do
Pkg::Util::Net.rsync_to(
"#{local_repos_path}/",
Pkg::Config.distribution_server,
remote_repos_path
)
end
end
|