2
2
3
3
set -ex
4
4
5
+
6
+ need_curl () {
7
+ if command -v curl > /dev/null ; then
8
+ return 0
9
+ fi
10
+ dnf install --setopt=install_weak_deps=False -y /usr/bin/curl
11
+ }
12
+
5
13
get_custom_repo () {
6
14
url=" $1 "
7
15
fname=" $( basename " $url " ) "
8
16
dest=" /etc/yum.repos.d/${fname} "
9
- dnf install --setopt=install_weak_deps=False -y /usr/bin/curl
17
+ need_curl
10
18
curl -L " $url " -o " $dest "
11
19
}
12
20
21
+ generate_repo_from_shaman () {
22
+ url=" $1 "
23
+ dest=" /etc/yum.repos.d/$2 "
24
+ need_curl
25
+ tmpfile=/tmp/shaman.json
26
+ curl -L " $url " -o " ${tmpfile} " && python3 << EOF
27
+ json_file = "${tmpfile} "
28
+ dest = "${dest} "
29
+ import json
30
+ r = json.load(open(json_file))
31
+ url = r[0]["url"]
32
+ ref = r[0]["ref"]
33
+ with open(dest, "w") as out:
34
+ print(f"[ceph-{ref}]", file=out)
35
+ print(f"name=Ceph Development Build ({ref})", file=out)
36
+ print(f"baseurl={url}/x86_64", file=out)
37
+ print("enabled=1", file=out)
38
+ print("gpgcheck=0", file=out)
39
+ EOF
40
+ rm -rf " ${tmpfile} "
41
+ }
42
+
13
43
install_packages_from=" $1 "
14
44
samba_version_suffix=" $2 "
15
45
install_custom_repo=" $3 "
@@ -23,12 +53,25 @@ case "${install_packages_from}" in
23
53
get_custom_repo " https://artifacts.ci.centos.org/samba/pkgs/master/${OS_BASE} /samba-nightly-master.repo"
24
54
package_selection=${package_selection:- nightly}
25
55
;;
56
+ devbuilds)
57
+ # devbuilds - samba nightly dev builds and ceph dev builds
58
+ get_custom_repo " https://artifacts.ci.centos.org/samba/pkgs/master/${OS_BASE} /samba-nightly-master.repo"
59
+ 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
60
+ dnf install --setopt=install_weak_deps=False -y epel-release
61
+ package_selection=${package_selection:- devbuilds}
62
+ ;;
26
63
custom-repo)
27
64
get_custom_repo " ${install_custom_repo} "
28
65
;;
29
66
esac
30
67
31
68
69
+ dnf_cmd=(dnf)
70
+ if [[ " ${OS_BASE} " = centos ]]; then
71
+ dnf_cmd+=(--enablerepo=crb --enablerepo=resilientstorage)
72
+ fi
73
+
74
+
32
75
# Assorted packages that must be installed in the container image to
33
76
# support the functioning of the container
34
77
support_packages=(\
@@ -50,6 +93,14 @@ case "${package_selection}-${OS_BASE}" in
50
93
* -fedora|allvfs-* )
51
94
samba_packages+=(samba-vfs-cephfs samba-vfs-glusterfs)
52
95
;;
96
+ devbuilds-centos|forcedevbuilds-* )
97
+ dnf_cmd+=(--enablerepo=epel)
98
+ samba_packages+=(samba-vfs-cephfs)
99
+ # these packages should be installed as deps. of sambacc extras
100
+ # however, the sambacc builds do not enable the extras on centos atm.
101
+ # Once this is fixed this line ought to be removed.
102
+ support_packages+=(python3-pyyaml python3-tomli python3-rados)
103
+ ;;
53
104
esac
54
105
55
106
# Assign version suffix to samba packages
@@ -58,10 +109,6 @@ for p in "${samba_packages[@]}"; do
58
109
samba_versioned_packages+=(" ${p}${samba_version_suffix} " )
59
110
done
60
111
61
- dnf_cmd=(dnf)
62
- if [[ " ${OS_BASE} " = centos ]]; then
63
- dnf_cmd+=(--enablerepo=crb --enablerepo=resilientstorage)
64
- fi
65
112
66
113
" ${dnf_cmd[@]} " \
67
114
install --setopt=install_weak_deps=False -y \
0 commit comments