- job: name: tcwg-cleanup-results-master project-type: freestyle defaults: global logrotate: daysToKeep: 30 numToKeep: 30 properties: - authorization: anonymous: - job-read - job-extended-read linaro: - job-build - job-cancel - job-workspace parameters: - string: name: log_name default: tcwg-backport-SHA1/$host.$target description: 'Log directory on $log_server to remove; you can use shell wildcards' - string: name: log_server default: ex40-01.tcwglab.linaro.org:logs-test description: 'Log_Server' disabled: false node: tcwg-x86_64-ex40 || tcwg-x86_64-ex40build-01 retry-count: 3 display-name: 'Cleanup results' wrappers: - timeout: timeout: 60 - timestamps - ssh-agent-credentials: # tcwg-buildslave user id users: - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a' - build-name: name: '#${BUILD_NUMBER}-${ENV,var="log_name"}' builders: - shell: | #!/bin/bash set -e set -x basedir="${log_server#*:}" log_server="${log_server%:*}" # These lists need to be kept up-to-date with tcwg-buildfarm-master job. hosts=( aarch64 x86_64 ) targets=( aarch64-linux-gnu aarch64-none-elf aarch64_be-none-elf arm-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf native schroot-i386-native schroot-armhf-native ) # Disable shell wild-card expansion to handle $log_names with wildcards. set -f dirs="" for host in "${hosts[@]}"; do for target in "${targets[@]}"; do eval "dirs=\"$dirs $basedir/$log_name\"" done done dirs="$(echo "$dirs" | sort -u)" ssh $log_server "rm -rf $dirs" set +f