stop hardcoding in specific places
Some checks failed
Build empanada images for imagefactory / buildx (push) Failing after 5s
Build empanada container images for lorax / buildx (push) Successful in 2s

This commit is contained in:
Louis Abel 2024-12-17 23:03:45 -07:00
parent 0e3727d637
commit ba5fe93f98
Signed by: label
GPG key ID: 2A6975660E424560
4 changed files with 14 additions and 18 deletions

View file

@ -285,7 +285,8 @@ function modifyrepo_module() {
function sign_data() { function sign_data() {
local TARGET="${1}" local TARGET="${1}"
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \ local VER="${2}"
test -f "/root/bin/sign-repo-${VER}.sh" && "/root/bin/sign-repo-${VER}.sh" \
"${TARGET}" "${TARGET}"
} }

View file

@ -105,8 +105,8 @@ fi
# Change Symlink if required # Change Symlink if required
echo "Setting symlink to ${REV}" echo "Setting symlink to ${REV}"
pushd "${STAGING_ROOT}/${CATEGORY_STUB}" || exit pushd "${STAGING_ROOT}/${CATEGORY_STUB}" || exit
/bin/rm "${STAGING_ROOT}/${CATEGORY_STUB}/latest-8" /bin/rm "${STAGING_ROOT}/${CATEGORY_STUB}/latest-${MAJ}"
ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" latest-8 ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" "latest-${MAJ}"
echo "Attempting hard link" echo "Attempting hard link"
perform_hardlink "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" perform_hardlink "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
popd || exit popd || exit

View file

@ -10,8 +10,7 @@ for y in "${ALL_REPOS[@]}"; do
if [ "$ret_val" -eq 0 ]; then if [ "$ret_val" -eq 0 ]; then
sed -i '/<open-size><\/open-size>/d' \ sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml" "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml"
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \ sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml" "${MAJ}"
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml"
else else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree does not exist" echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree does not exist"
fi fi
@ -29,8 +28,7 @@ for x in "${ARCHES[@]}"; do
if [ "$ret_val" -eq 0 ]; then if [ "$ret_val" -eq 0 ]; then
sed -i '/<open-size><\/open-size>/d' \ sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml" "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml"
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \ sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml" "${MAJ}"
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml"
else else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z} does not exist" echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z} does not exist"
fi fi
@ -43,8 +41,7 @@ for x in "${ARCHES[@]}"; do
if [ "$ret_val" -eq 0 ]; then if [ "$ret_val" -eq 0 ]; then
sed -i '/<open-size><\/open-size>/d' \ sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml" "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml"
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \ sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml" "${MAJ}"
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml"
else else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree does not exist" echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree does not exist"
fi fi
@ -60,8 +57,7 @@ for x in "${ARCHES[@]}"; do
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml" "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
sed -i '/<open-size><\/open-size>/d' \ sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/kickstart/repodata/repomd.xml" "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/kickstart/repodata/repomd.xml"
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \ sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml" "${MAJ}"
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
else else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist" echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist"
fi fi
@ -77,8 +73,7 @@ for x in "${ARCHES[@]}"; do
sed -i '/<open-size><\/open-size>/d' \ sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/kickstart/repodata/repomd.xml" "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/kickstart/repodata/repomd.xml"
# This might not be necessary, but it does not hurt incase repomd is modified # This might not be necessary, but it does not hurt incase repomd is modified
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \ sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml" "${MAJ}"
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
else else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist" echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist"
fi fi

View file

@ -59,7 +59,7 @@ if [ $ret_val -eq "0" ]; then
if [ $ret_val -eq "0" ]; then if [ $ret_val -eq "0" ]; then
createrepo_update "${TARGET}/${src_repo}" "${REVISION}" createrepo_update "${TARGET}/${src_repo}" "${REVISION}"
fix_metadata "${TARGET}/${src_repo}/repodata/repomd.xml" fix_metadata "${TARGET}/${src_repo}/repodata/repomd.xml"
sign_data "${TARGET}/${src_repo}/repodata/repomd.xml" sign_data "${TARGET}/${src_repo}/repodata/repomd.xml" "${RLVER}"
else else
echo "${src_repo} not found" echo "${src_repo} not found"
fi fi
@ -77,7 +77,7 @@ if [ $ret_val -eq "0" ]; then
if [ $ret_val -eq "0" ]; then if [ $ret_val -eq "0" ]; then
createrepo_update "${TARGET}/${debug_repo}" "${REVISION}" createrepo_update "${TARGET}/${debug_repo}" "${REVISION}"
fix_metadata "${TARGET}/${debug_repo}/repodata/repomd.xml" fix_metadata "${TARGET}/${debug_repo}/repodata/repomd.xml"
sign_data "${TARGET}/${debug_repo}/repodata/repomd.xml" sign_data "${TARGET}/${debug_repo}/repodata/repomd.xml" "${RLVER}"
else else
echo "${debug_repo} not found" echo "${debug_repo} not found"
fi fi
@ -94,7 +94,7 @@ if [ $ret_val -eq "0" ]; then
if [ $ret_val -eq "0" ]; then if [ $ret_val -eq "0" ]; then
createrepo_comps "${REPO_PATH}" "${REVISION}" "${COMP_PATH}" createrepo_comps "${REPO_PATH}" "${REVISION}" "${COMP_PATH}"
fix_metadata "${REPO_PATH}/repodata/repomd.xml" fix_metadata "${REPO_PATH}/repodata/repomd.xml"
sign_data "${REPO_PATH}/repodata/repomd.xml" sign_data "${REPO_PATH}/repodata/repomd.xml" "${RLVER}"
else else
echo "${comp_repo} not found" echo "${comp_repo} not found"
fi fi
@ -120,7 +120,7 @@ if [ $ret_val -eq "0" ]; then
if [ $ret_val -eq 0 ]; then if [ $ret_val -eq 0 ]; then
modifyrepo_module "${MOD_PATH}" "${MOD_YAML}" modifyrepo_module "${MOD_PATH}" "${MOD_YAML}"
fix_metadata "${MOD_PATH}/repomd.xml" fix_metadata "${MOD_PATH}/repomd.xml"
sign_data "${MOD_PATH}/repomd.xml" sign_data "${MOD_PATH}/repomd.xml" "${RLVER}"
else else
echo "${mod_repo} not found" echo "${mod_repo} not found"
fi fi
@ -134,7 +134,7 @@ if [ $ret_val -eq "0" ]; then
if [ $ret_val -eq "0" ]; then if [ $ret_val -eq "0" ]; then
createrepo_update "${TARGET}/${arch_repo}" "${REVISION}" createrepo_update "${TARGET}/${arch_repo}" "${REVISION}"
fix_metadata "${TARGET}/${arch_repo}/repodata/repomd.xml" fix_metadata "${TARGET}/${arch_repo}/repodata/repomd.xml"
sign_data "${TARGET}/${arch_repo}/repodata/repomd.xml" sign_data "${TARGET}/${arch_repo}/repodata/repomd.xml" "${RLVER}"
else else
echo "${arch_repo} not found" echo "${arch_repo} not found"
fi fi