Skip to content

Commit 3a8dbaa

Browse files
committed
Adds extra-repos element
1 parent 681fbba commit 3a8dbaa

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

elements/extra-repos/README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
===========
2+
extra-repos
3+
===========
4+
5+
Installs extra repos prior to package install
6+
7+
* ``DIB_EXTRA_REPOS`` A space separated list of repos to install
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
4+
set -x
5+
fi
6+
7+
set -euo pipefail
8+
9+
case "$DISTRO_NAME" in
10+
centos* | rhel* | rocky*)
11+
rpm -q dnf-plugins-core || dnf install -y dnf-plugins-core
12+
for repo in ${DIB_EXTRA_REPOS:-}; do
13+
dnf config-manager --add-repo "$repo"
14+
done
15+
;;
16+
*)
17+
echo "Distro \"$DISTRO_NAME\" is not supported"
18+
exit 1
19+
;;
20+
esac
21+
22+
exit 0

0 commit comments

Comments
 (0)