Skip to content

Commit a5244a3

Browse files
phlogistonjohnobnoxxx
authored andcommitted
images/server: make it easier to do custom package builds
Creating a custom "devbuilds" container with custom ceph packages and/or custom samba packages was somewhat annoying. Tweak the install-packages.sh to try and make it slightly easier to do one of these builds. Signed-off-by: John Mulligan <[email protected]>
1 parent e832f6b commit a5244a3

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

images/server/install-packages.sh

+37-8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,31 @@ EOF
4040
rm -rf "${tmpfile}"
4141
}
4242

43+
get_samba_nightly_repo() {
44+
get_custom_repo "https://artifacts.ci.centos.org/samba/pkgs/master/${OS_BASE}/samba-nightly-master.repo"
45+
}
46+
47+
get_distro_ceph_repo() {
48+
if [[ "${OS_BASE}" = centos ]]; then
49+
dnf install --setopt=install_weak_deps=False -y \
50+
epel-release centos-release-ceph-reef
51+
fi
52+
}
53+
54+
get_epel_repo_if_needed() {
55+
if [[ "${OS_BASE}" = centos ]]; then
56+
dnf install --setopt=install_weak_deps=False -y epel-release
57+
fi
58+
}
59+
60+
get_ceph_shaman_repo() {
61+
ceph_ref="${CEPH_REPO_REF:-main}"
62+
ceph_sha="${CEPH_REPO_SHA:-latest}"
63+
url="https://shaman.ceph.com/api/search/?project=ceph&distros=${OS_BASE}/9/x86_64&flavor=default&ref=${ceph_ref}&sha1=${ceph_sha}"
64+
generate_repo_from_shaman "${url}" "ceph-${ceph_ref}.repo"
65+
cat "/etc/yum.repos.d/ceph-${ceph_ref}.repo"
66+
}
67+
4368
install_packages_from="$1"
4469
samba_version_suffix="$2"
4570
install_custom_repo="$3"
@@ -50,22 +75,26 @@ OS_BASE="$(. /etc/os-release && echo "${ID}")"
5075

5176
case "${install_packages_from}" in
5277
samba-nightly)
53-
get_custom_repo "https://artifacts.ci.centos.org/samba/pkgs/master/${OS_BASE}/samba-nightly-master.repo"
54-
if [[ "${OS_BASE}" = centos ]]; then
55-
dnf install --setopt=install_weak_deps=False -y \
56-
epel-release centos-release-ceph-reef
57-
fi
78+
get_samba_nightly_repo
79+
get_distro_ceph_repo
5880
package_selection=${package_selection:-nightly}
5981
;;
6082
devbuilds)
83+
get_samba_nightly_repo
6184
# devbuilds - samba nightly dev builds and ceph dev builds
62-
get_custom_repo "https://artifacts.ci.centos.org/samba/pkgs/master/${OS_BASE}/samba-nightly-master.repo"
63-
generate_repo_from_shaman "https://shaman.ceph.com/api/search/?project=ceph&distros=${OS_BASE}/9/x86_64&flavor=default&ref=main&sha1=latest" ceph-main.repo
64-
dnf install --setopt=install_weak_deps=False -y epel-release
85+
get_ceph_shaman_repo
86+
get_epel_repo_if_needed
6587
package_selection=${package_selection:-devbuilds}
6688
;;
6789
custom-repo)
6890
get_custom_repo "${install_custom_repo}"
91+
get_distro_ceph_repo
92+
;;
93+
custom-devbuilds)
94+
get_custom_repo "${install_custom_repo}"
95+
get_ceph_shaman_repo
96+
get_epel_repo_if_needed
97+
package_selection=${package_selection:-devbuilds}
6998
;;
7099
esac
71100

0 commit comments

Comments
 (0)