Try to get splitter working so that EPEL Stream work can start
Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
This commit is contained in:
parent
9bc5e017e3
commit
e3ae9a8c13
3 changed files with 110 additions and 1 deletions
1
roles/grobisplitter/files/cents8-split.cron
Normal file
1
roles/grobisplitter/files/cents8-split.cron
Normal file
|
@ -0,0 +1 @@
|
|||
10 10 * * * root /usr/local/bin/centos-stream8-split.sh
|
108
roles/grobisplitter/files/cents8-split.sh
Executable file
108
roles/grobisplitter/files/cents8-split.sh
Executable file
|
@ -0,0 +1,108 @@
|
|||
#!/bin/bash
|
||||
|
||||
## Setup basic environment variables.
|
||||
HOMEDIR=/mnt/fedora/app/fi-repo/centos/centos-8-stream
|
||||
BINDIR=/usr/local/bin
|
||||
|
||||
ARCHES="aarch64 ppc64le x86_64"
|
||||
DATE=$(date -Ih | sed 's/+.*//')
|
||||
|
||||
DATEDIR=${HOMEDIR}/koji/${DATE}
|
||||
|
||||
##
|
||||
## Make a directory for where the new tree will live. Use a new date
|
||||
## so that we can roll back to an older release or stop updates for
|
||||
## some time if needed.
|
||||
if [ -d ${DATEDIR} ]; then
|
||||
echo "Directory already exists. Please remove or fix"
|
||||
exit
|
||||
else
|
||||
mkdir -p ${DATEDIR}
|
||||
fi
|
||||
|
||||
##
|
||||
## Go through each architecture and
|
||||
##
|
||||
for ARCH in ${ARCHES}; do
|
||||
# The archdir is where we daily download updates for rhel8
|
||||
ARCHDIR=${HOMEDIR}/${ARCH}
|
||||
if [ ! -d ${ARCHDIR} ]; then
|
||||
echo "Unable to find ${ARCHDIR}"
|
||||
exit
|
||||
fi
|
||||
|
||||
# We consolidate all of the default repositories and remerge them
|
||||
# in a daily tree. This allows us to point koji at a particular
|
||||
# day if we have specific build concerns.
|
||||
OUTDIR=${DATEDIR}/${ARCH}
|
||||
mkdir -p ${OUTDIR}
|
||||
if [ ! -d ${OUTDIR} ]; then
|
||||
echo "Unable to find ${ARCHDIR}"
|
||||
exit
|
||||
else
|
||||
cd ${OUTDIR}
|
||||
fi
|
||||
|
||||
# Begin splitting the various packages into their subtrees
|
||||
${BINDIR}/splitter.py --action hardlink --target CS-8-001 BaseOS/${ARCHDIR}/os/ --only-defaults &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "splitter ${ARCH} baseos failed"
|
||||
exit
|
||||
fi
|
||||
${BINDIR}/splitter.py --action hardlink --target CS-8-002 AppStream/${ARCHDIR}/os/ --only-defaults &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "splitter ${ARCH} appstream failed"
|
||||
exit
|
||||
fi
|
||||
${BINDIR}/splitter.py --action hardlink --target CS-8-003 PowerTools/${ARCHDIR}/os/ &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "splitter ${ARCH} codeready failed"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Copy the various module trees into CS-8-001 where we want them
|
||||
# to work.
|
||||
echo "Moving data to ${ARCH}/CS-8-001"
|
||||
cp -anlr CS-8-002/* CS-8-001
|
||||
cp -anlr CS-8-003/* CS-8-001
|
||||
# Go into the main tree
|
||||
pushd CS-8-001
|
||||
|
||||
# Mergerepo didn't work so lets just createrepo in the top directory.
|
||||
createrepo_c . &> /dev/null
|
||||
popd
|
||||
|
||||
# Cleanup the trash
|
||||
rm -rf CS-8-002 CS-8-003
|
||||
#loop to the next
|
||||
done
|
||||
|
||||
## Set up the builds so they are pointing to the last working version
|
||||
cd ${HOMEDIR}/koji/
|
||||
if [[ -e staged ]]; then
|
||||
if [[ -h staged ]]; then
|
||||
rm -f staged
|
||||
else
|
||||
echo "Unable to remove staged. it is not a symbolic link"
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo "No staged link found"
|
||||
fi
|
||||
|
||||
echo "Linking ${DATE} to staged"
|
||||
ln -s ${DATE} staged
|
||||
|
||||
|
||||
for ARCH in ${ARCHES}; do
|
||||
pushd latest/
|
||||
mkdir -p ${ARCH}
|
||||
dnf --disablerepo=\* --enablerepo=CS-8-001 --repofrompath=CS-8-001,https://infrastructure.fedoraproject.org/repo/rhel/rhel8/koji/staged/${ARCH}/CS-8-001/ reposync -a ${ARCH} -a noarch -p ${ARCH} --newest --delete &> /dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
cd ${ARCH}/CS-8-001
|
||||
createrepo_c . &> /dev/null
|
||||
else
|
||||
echo "Unable to run createrepo on latest/${ARCH}"
|
||||
fi
|
||||
popd
|
||||
done
|
|
@ -1 +1 @@
|
|||
03 09 * * * root /usr/local/bin/rhel8-split.sh
|
||||
10 09 * * * root /usr/local/bin/rhel8-split.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue