Skip to content

Commit

Permalink
Introduce some hooks for automatical intergration
Browse files Browse the repository at this point in the history
  • Loading branch information
arenekosreal committed Aug 30, 2023
1 parent 0870961 commit 530804b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ pkg
# ACT
.actrc
*.env

# Hooks
before-build
on-package-build
after-build
13 changes: 13 additions & 0 deletions start-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ function get_aarch64_binfmt_item() {
done
}

function exec_hook() {
# exec_hook $file $args
[[ -x "./$1" ]] && "./$1" "$2" || echo "Hook $1 failed to execute!"
return 0
}

echo 'Printing variables:'
echo " CHROOT_MAKEPKG_ARGS=${CHROOT_MAKEPKG_ARGS}"
echo " MAKECHROOTPKG_ARGS=${MAKECHROOTPKG_ARGS}"
Expand Down Expand Up @@ -200,12 +206,15 @@ else
fi
fi

exec_hook before-build

while read -r relative_package
do
is_in_line "${root}/tmp/status" "${relative_package}" && continue
[[ -f "${root}/skip" ]] && is_in_line "${root}/skip" "${relative_package}" && continue
[[ ! -f "${root}/${relative_package}/PKGBUILD" ]] && continue
echo "Processing ${relative_package} folder..."
exec_hook on-package-build "${relative_package}"
cd "${root}/${relative_package}"
if [[ $(uname -m) == "aarch64" ]]
then
Expand All @@ -217,8 +226,12 @@ do
fi
echo "${relative_package}" >> "${root}/tmp/status"
done < "${root}/build-orders"

[[ -f "${root}/tmp/status" ]] && rm -f "${root}/tmp/status"

if ! ${CI} && ${TMPFS}
then
${SUDO} umount "${root}/tmp"
fi

exec_hook after-build

0 comments on commit 530804b

Please sign in to comment.