-
Notifications
You must be signed in to change notification settings - Fork 26
/
release.groovy
60 lines (49 loc) · 2.23 KB
/
release.groovy
1
2
3
4
5
6
7
8
9
10
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
void push_foreman_rpms(repo_type, version, distro) {
version = version == 'develop' ? 'nightly' : version
push_rpms("foreman-${repo_type}-${version}", repo_type, version, distro)
}
void push_rpms(repo_src, repo_dest, version, distro, keep_old_files = false, staging = false) {
push_rpms_direct("${repo_src}/${distro}", "${repo_dest}/${version}/${distro}", !keep_old_files, keep_old_files, staging)
}
void push_rpms_direct(repo_source, repo_dest, overwrite = true, merge = false, staging = false) {
sshagent(['repo-sync']) {
sh "ssh [email protected] ${repo_source} ${repo_dest} ${overwrite} ${merge} ${staging}"
}
}
void push_rpms_katello(version) {
sshagent(['katello-fedorapeople']) {
sh "ssh [email protected] 'cd /project/katello/bin && sh rsync-repos-from-koji ${version}'"
}
}
void push_debs_direct(os, repo) {
sshagent(['freight']) {
sh "ssh [email protected] deploy ${os} ${repo}"
}
}
void push_pulpcore_rpms(version, distro) {
push_rpms("pulpcore-${version}", "pulpcore", version, distro, true)
}
void push_katello_rpms(version, distro) {
keep_old = version != 'nightly'
push_rpms_direct("katello-${version}/katello/${distro}", "katello/${version}/katello/${distro}", !keep_old, keep_old)
push_rpms_direct("katello-${version}/candlepin/${distro}", "katello/${version}/candlepin/${distro}", !keep_old, keep_old)
}
void mash(collection, version) {
sshagent(['mash']) {
sh "ssh -o 'BatchMode yes' [email protected] collection-mash-split.py ${collection} ${version}"
}
}
void push_staging_rpms(repo_src, repo_dest, version, distro, keep_old_files = false) {
if (repo_dest == 'foreman') {
destination = "releases/${version}/${distro}"
} else if (repo_dest == 'katello') {
destination = "katello/${version}/katello/${distro}"
} else {
destination = "${repo_dest}/${version}/${distro}"
}
push_rpms_direct("${repo_src}/${distro}", destination, !keep_old_files, keep_old_files, true)
}
void push_foreman_staging_rpms(repo_type, version, distro) {
version = version == 'develop' ? 'nightly' : version
push_staging_rpms("${repo_type}/${version}", repo_type, version, distro)
}