@@ -60,13 +60,41 @@ add_repo() {
6060 fi
6161}
6262
63+ add_inst_repo () {
64+ local repo=" $1 "
65+ local branch=" $2 "
66+ local build_number=" $3 "
67+ local distro_name=" $4 "
68+ local bullseye=" ${5:- false} "
69+ local sudo=" ${6:- false} "
70+ local dnf_cmd=(" dnf" " -y" )
71+ local repo_base=" ${ARTIFACTS_URL:- ${JENKINS_URL} job/ } daos-stack/job/${repo} /job/${branch// \/ /% 252F} /${build_number} /artifact/artifacts"
72+ local repo_url=" ${repo_base} /$distro_name /"
73+ if [[ " $bullseye " == " true" ]]; then
74+ repo_url=" ${repo_base} /${distro_name} -bullseye/"
75+ fi
76+ if [[ " $sudo " == " true" ]]; then
77+ dnf_cmd=(" sudo" " ${dnf_cmd[@]} " )
78+ fi
79+ " ${dnf_cmd[@]} " config-manager --add-repo=" $repo_url "
80+ repo=" $( url_to_repo " $repo_url " ) "
81+ # PR-repos: should always be able to upgrade modular packages
82+ " ${dnf_cmd[@]} " config-manager --save --setopt " $repo .module_hotfixes=true" " $repo "
83+ disable_gpg_check " $repo_url " " $sudo "
84+ }
85+
6386disable_gpg_check () {
6487 local url=" $1 "
88+ local sudo=" ${2:- false} "
89+ local dnf_cmd=(" dnf" " -y" )
90+ if [[ " $sudo " == " true" ]]; then
91+ dnf_cmd=(" sudo" " ${dnf_cmd[@]} " )
92+ fi
6593
6694 repo=" $( url_to_repo " $url " ) "
6795 # bug in EL7 DNF: this needs to be enabled before it can be disabled
68- dnf -y config-manager --save --setopt=" $repo " .gpgcheck=1
69- dnf -y config-manager --save --setopt=" $repo " .gpgcheck=0
96+ " ${dnf_cmd[@]} " config-manager --save --setopt=" $repo " .gpgcheck=1
97+ " ${dnf_cmd[@]} " config-manager --save --setopt=" $repo " .gpgcheck=0
7098 # but even that seems to be not enough, so just brute-force it
7199 if [ -d /etc/yum.repos.d ] &&
72100 ! grep gpgcheck /etc/yum.repos.d/" $repo " .repo; then
@@ -304,6 +332,8 @@ update_repos() {
304332}
305333
306334post_provision_config_nodes () {
335+ local bullseye=" ${1:- false} "
336+
307337 # shellcheck disable=SC2154
308338 if ! update_repos " $DISTRO_NAME " ; then
309339 # need to use the image supplied repos
@@ -379,16 +409,7 @@ post_provision_config_nodes() {
379409 branch=" ${branch%:* } "
380410 fi
381411 fi
382- local subdir
383- if ! $COVFN_DISABLED ; then
384- subdir=" bullseye/"
385- fi
386- local repo_url=" ${ARTIFACTS_URL:- ${JENKINS_URL} job/ } " daos-stack/job/" $repo " /job/" ${branch// \/ /% 252F} " /" $build_number " /artifact/artifacts/" ${subdir:- } " $DISTRO_NAME /
387- dnf -y config-manager --add-repo=" $repo_url "
388- repo=" $( url_to_repo " $repo_url " ) "
389- # PR-repos: should always be able to upgrade modular packages
390- dnf -y config-manager --save --setopt " $repo .module_hotfixes=true" " $repo "
391- disable_gpg_check " $repo_url "
412+ add_inst_repo " ${repo} " " ${branch} " " ${build_number} " " ${DISTRO_NAME} " " ${bullseye} "
392413 done
393414
394415 # start with everything fully up-to-date
0 commit comments