Skip to content

Commit c5d65c8

Browse files
server: add new shell scripts to help build container image
Our container build files currently have a fair bit of logic in them. It's better to maintain them as shell scripts that get called inside the container. Not used yet. Signed-off-by: John Mulligan <[email protected]>
1 parent 1c683cb commit c5d65c8

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

images/server/install-packages.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
get_custom_repo() {
6+
url="$1"
7+
fname="$(basename "$url")"
8+
dest="/etc/yum.repos.d/${fname}"
9+
dnf install --setopt=install_weak_deps=False -y curl
10+
curl "$url" -o "$dest"
11+
}
12+
13+
install_packages_from="$1"
14+
case "${install_packages_from}" in
15+
samba-nightly)
16+
get_custom_repo "http://artifacts.ci.centos.org/gluster/nightly-samba/master/fedora/samba-nightly-master.repo"
17+
;;
18+
custom-repo)
19+
get_custom_repo "${INSTALL_CUSTOM_REPO}"
20+
;;
21+
esac
22+
23+
dnf install --setopt=install_weak_deps=False -y \
24+
findutils \
25+
python-pip \
26+
python3-jsonschema \
27+
python3-samba \
28+
samba \
29+
samba-client \
30+
samba-winbind \
31+
samba-winbind-clients \
32+
tdb-tools \
33+
ctdb
34+
dnf clean all
35+
36+
cp --preserve=all /etc/ctdb/functions /usr/share/ctdb/functions
37+
cp --preserve=all /etc/ctdb/notify.sh /usr/share/ctdb/notify.sh

images/server/install-sambacc.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
wheeldir="$1"
6+
container_json_file="$2"
7+
8+
wheeldir=/tmp
9+
wheel="$(find "${wheeldir}" -type f -name 'sambacc-*.whl')" \
10+
11+
if ! [ $(echo "$wheel" | wc -l) = 1 ]; then
12+
echo "more than one wheel file found"
13+
exit 1
14+
fi
15+
16+
pip install "$wheel"
17+
rm -f "$wheel"
18+
19+
if [ "$container_json_file" ]; then
20+
ln -sf "$container_json_file" /etc/samba/container.json
21+
fi

0 commit comments

Comments
 (0)