]>
git.ipfire.org Git - people/ms/nightly-builds.git/blob - server-scripts/ipfire-cleanup-nightly-builds.sh
5 ARCHES
["master"]="x86_64 i586"
6 ARCHES
["next"]="x86_64 i586 armv5tel"
8 MAX_AGE
=$
(( 7 * 24 * 3600 )) # 7 days
16 local arches
="${ARCHES[${branch}]}"
17 [ -z "${arches}" ] && return 0
20 for arch
in ${arches}; do
21 if [ ! -e "${release}/${arch}/.success" ]; then
29 for branch
in $
(find "${BASEDIR}" -mindepth 1 -maxdepth 1 -type d
); do
32 for build
in $
(find "${branch}" -mindepth 1 -maxdepth 1 -type d |
sort -nr); do
33 time="$(basename "${build}")"
34 [ "${time}" = "latest" ] && continue
36 # Never delete the last two builds
37 if [ "${counter}" -lt 2 ] && all_successful "$(basename ${branch})" "${build}"; then
38 counter
=$
(( ${counter} + 1 ))
42 # Determine age of the build
43 change
="$(stat --format="%Y
" "${build}")"
44 age
=$
(( ${NOW} - ${change} ))
46 # If the build is old enough we will delete it
47 if [[ ${age} -ge ${MAX_AGE} ]]; then