install xq on build server and use in hudson's crontab to clean workspace of disables jobs

This commit is contained in:
Axel Uhl
2024-08-22 14:31:00 +02:00
parent c47f86b28f
commit 9bd55b2561
2 changed files with 3 additions and 0 deletions
@@ -26,6 +26,8 @@ else
if ! build_crontab_and_setup_files build_server; then
exit 1
fi
# Install "xq" which is used by a hudson cron job to clean up workspaces of disabled jobs:
curl -sSL https://bit.ly/install-xq | sudo bash
# Make eu-west-1 the default region for any aws CLI interaction:
sudo su - -c "aws configure set default.region eu-west-1"
# Clear "hudson" user's directory again which is to become a mount point
@@ -0,0 +1 @@
23 3 * * * export PATH=${PATH}:/usr/local/bin; for i in /home/hudson/repo/jobs/*; do if [ "$( xq -x /project/disabled ${i}/config.xml 2>/dev/null )" = "true" ]; then rm -rf "${i}/workspace"; fi; done