mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-22 08:58:47 +00:00
Generalize the packge building scripts to be able to be run on more than
one 'head' node, rather than just pointyhat itself. Constants are factored out into installation-specific files known as portbuild/conf/server.conf and portbuild/conf/client.conf. There is only one server.conf file. Individual <arch> directories may have their own client.conf files, or may symlink to ../conf/client.conf. This first set of files only gets the *.conf files and some cleanup. Feature safe: yes
This commit is contained in:
parent
efb351f724
commit
ae733423e0
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=256975
@ -28,6 +28,7 @@ shift 4
|
||||
|
||||
builddir=${pb}/${arch}/${branch}/builds/${buildid}
|
||||
|
||||
. ${pb}/conf/server.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/scripts/buildenv
|
||||
|
||||
|
@ -22,6 +22,7 @@ shift 4
|
||||
|
||||
builddir=${pb}/${arch}/${branch}/builds/${buildid}
|
||||
|
||||
. ${pb}/conf/server.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/scripts/buildenv
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# client-side script to claim a chroot
|
||||
|
||||
# usage: claim-chroot ${arch} ${branch} ${pkgname} ${buildid}
|
||||
|
||||
# Care needs to be taken with the output of this script, it cannot
|
||||
@ -62,11 +64,9 @@ if [ ! -f ${builddir}/.ready ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
. ${pb}/${arch}/client.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/${arch}/portbuild.$(hostname)
|
||||
. ${pb}/scripts/buildenv
|
||||
|
||||
buildenv ${pb} ${arch} ${branch} ${builddir}
|
||||
|
||||
buildroot=${scratchdir}
|
||||
pkgname=${pkgname%.${PKGSUFFIX}}
|
||||
|
@ -1,11 +1,14 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
# To be run on the client, this script looks for chroot directories
|
||||
# that have not been used in 60 minutes, as well as directories listed
|
||||
# as 'in use' that have not been touched in 5 days (corresponding to
|
||||
# port builds that have timed out or shut down uncleanly) and prunes
|
||||
# them to reclaim space.
|
||||
|
||||
pb=/var/portbuild
|
||||
|
||||
kill_procs()
|
||||
{
|
||||
dir=$1
|
||||
@ -38,9 +41,10 @@ cleanup_mount() {
|
||||
fi
|
||||
}
|
||||
|
||||
pb=/var/portbuild
|
||||
# note: uname is not being overridden (should not need client.conf here)
|
||||
arch=$(uname -m)
|
||||
|
||||
. ${pb}/${arch}/client.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/${arch}/portbuild.$(hostname)
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# Collect metrics for ganglia:
|
||||
# Client script to collect metrics for ganglia:
|
||||
# - current vnodes
|
||||
# - max vnodes
|
||||
# - number of packages built in the past hour
|
||||
@ -16,6 +17,7 @@ gmetric --name="maxvnodes" --value=`sysctl -n kern.maxvnodes` --tmax=120 --dmax=
|
||||
gmetric --name="vnodes" --value=`sysctl -n vfs.numvnodes` --tmax=120 --dmax=0 --type=uint32 --units="# vnodes"
|
||||
|
||||
if [ -f ${pb}/${arch}/portbuild.conf -a -f ${pb}/${arch}/portbuild.${me} ]; then
|
||||
. ${pb}/${arch}/client.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/${arch}/portbuild.${me}
|
||||
else
|
||||
|
@ -1,7 +1,12 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# client script to be manually run to flush squid cache, whenever needed
|
||||
|
||||
# note: uname is not being overridden
|
||||
arch=$(uname -m)
|
||||
pb=/var/portbuild
|
||||
. ${pb}/${arch}/client.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
|
||||
host=$(hostname)
|
||||
|
@ -1,4 +1,7 @@
|
||||
#!/bin/sh -x
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
# server-side script to save off RESTRICTED files
|
||||
|
||||
usage () {
|
||||
echo "usage: keeprestr arch branch buildid"
|
||||
@ -15,6 +18,7 @@ buildid=$3
|
||||
|
||||
pb=/var/portbuild
|
||||
|
||||
. ${pb}/conf/server.conf
|
||||
. ${pb}/scripts/buildenv
|
||||
|
||||
buildid=$(resolve ${pb} ${arch} ${branch} ${buildid})
|
||||
@ -30,3 +34,4 @@ rm -rf bak/restricted
|
||||
mkdir -p bak/restricted
|
||||
|
||||
(tr ';' '\n' < restricted.sh | grep "/bin/rm -f" | awk '{print $3}' | grep packages/ | sed -e "s,${builddir}/,," -e 's,)$,,' | xargs ls -1 2>/dev/null) | cpio -dumpl bak/restricted/
|
||||
|
||||
|
@ -18,6 +18,7 @@ shift 3
|
||||
|
||||
builddir=${pb}/${arch}/${branch}/builds/${buildid}
|
||||
|
||||
. ${pb}/conf/server.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/scripts/buildenv
|
||||
|
||||
|
@ -26,6 +26,7 @@ buildid=$3
|
||||
shift 3
|
||||
|
||||
pb=/var/portbuild
|
||||
. ${pb}/conf/server.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
|
||||
. ${pb}/scripts/buildenv
|
||||
@ -48,7 +49,7 @@ cleandir ${tmpdir}
|
||||
mkdir -p ${tmpdir}
|
||||
|
||||
# Copy the files into the tmpdir from an existing built world
|
||||
destdir=${worlddir}/${arch}/${branch}
|
||||
destdir=${WORLDDIR}/${arch}/${branch}
|
||||
cd ${destdir}; find -dx . | \
|
||||
grep -v -E '^./usr/(local|obj|opt|ports|src)' | \
|
||||
grep -v '^./home' | \
|
||||
|
@ -28,10 +28,10 @@ branch=$2
|
||||
buildid=$3
|
||||
shift 3
|
||||
|
||||
. ${pb}/conf/server.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
. ${pb}/scripts/buildenv
|
||||
|
||||
|
||||
builddir=${pb}/${arch}/${branch}/builds/${buildid}
|
||||
|
||||
buildenv ${pb} ${arch} ${branch} ${builddir}
|
||||
|
@ -1,12 +1,14 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This is run on the clients to report their loads to the server.
|
||||
# $FreeBSD$
|
||||
|
||||
# client script to report load to the server.
|
||||
|
||||
# configurable variables
|
||||
pb=/var/portbuild
|
||||
# note: uname is not being overridden
|
||||
arch=$(uname -m)
|
||||
osver=$(sysctl -n kern.osreldate)
|
||||
|
||||
. ${pb}/${arch}/client.conf
|
||||
. ${pb}/${arch}/portbuild.conf
|
||||
if [ -f ${pb}/${arch}/portbuild.$(hostname) ]; then
|
||||
. ${pb}/${arch}/portbuild.$(hostname)
|
||||
|
Loading…
Reference in New Issue
Block a user