diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-05-03 13:14:54 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2018-05-04 09:07:52 +0000 |
commit | 08e6a3ee97916791a0993172f36be7f11429569e (patch) | |
tree | 17d99269f23286818367ad5d55ecf1690a3c149c /tcwg-buildfarm.yaml | |
parent | 4d1762d7d065ba7b4ad78b7b4227b625ca2cd53d (diff) |
tcwg-buildfarm.yaml: Move code to jenkins-scripts
Change-Id: I4fa81cdb4e25eadbe9f470247f87505f5f738bfa
Diffstat (limited to 'tcwg-buildfarm.yaml')
-rw-r--r-- | tcwg-buildfarm.yaml | 166 |
1 files changed, 1 insertions, 165 deletions
diff --git a/tcwg-buildfarm.yaml b/tcwg-buildfarm.yaml index 7d1f0def..66151336 100644 --- a/tcwg-buildfarm.yaml +++ b/tcwg-buildfarm.yaml @@ -153,171 +153,7 @@ builders: - shell: | #!/bin/bash - - set -ex - - mkdir -p artifacts/ - - . ./jenkins-scripts/jenkins-helpers.sh - - builder_type=$(print_type_for_label $label) - - if [ x"$target" = x"$label" ]; then - target_opt="--target native" - elif [ x"$target" = x"aarch64-linux-gnu_ilp32" ]; then - target_opt="--target $target --override \"--extraconfigdir ../config/ilp32-dev\"" - else - target_opt="--target $target" - fi - - # Start build container - bash -x ./jenkins-scripts/start-container-docker.sh --label $label --node $NODE_NAME --distro ${build_container_tag} --prefix build_ > build-container.sh - - # Define build_CONTAINER_RSH and build_container_cleanup - . ./build-container.sh - - # Make sure to cleanup build container if something goes - # wrong when preparing the test environment - trap "cleanup_all_containers" EXIT - - runtests_opt="" - if echo $runtests | grep -q $target; then - runtests_opt="--runtests" - - tester_label=$(print_tester_label_for_target $target) - if [ x"$tester_label" != x"" ]; then - if [ x"$target" != x"aarch64-linux-gnu_ilp32" ]; then - bash -x ./jenkins-scripts/start-container-docker.sh --label $tester_label --distro trusty --task test --prefix test_ > test-container.sh - else - # Set weight to "2" to give VM decent amount of RAM. - bash -x ./jenkins-scripts/start-container-qemu.sh --weight 2 --label $tester_label --distro xenial --task test --prefix test_ --kernel_url https://dev-01.tcwglab/~tcwg-buildslave/images/ilp32/norov-Image --initrd_url https://cloud-images.ubuntu.com/releases/16.04/release/unpacked/ubuntu-16.04-server-cloudimg-arm64-initrd-generic > test-container.sh - fi - . ./test-container.sh - runtests_opt="$runtests_opt --testcontainer ${test_container_host}:${test_container_port}" - fi - fi - - if [ "x${send_results_to}" != x ]; then - send_results_to="--send-results-to ${send_results_to}" - fi - - ${build_CONTAINER_RSH} 'echo "Build session is up; ulimit config:"; ulimit -a' - - case $label in - tcwg-x86_*-build) languages="$host_x86_64_languages" ;; - *) languages="$host_aarchXX_languages" ;; - esac - - if $try_bootstrap; then - bootstrap="--bootstrap" - else - bootstrap="" - fi - - if [ x"$log_name" != x"" ]; then - eval "logname_opt=\"--logname $log_name\"" - fi - - if $rebuild; then - norebuild="" - else - norebuild="--norebuild" - fi - - # --tarbin needs to be passed to jenkins.sh as a user option - if $binaries; then - options="-o --tarbin" - else - options="" - fi - - case $label in - tcwg-x86_*-build) excludecheck="$host_x86_64_excludecheck" ;; - *) excludecheck="$host_aarchXX_excludecheck" ;; - esac - - excludecheck_opt="" - for testsuite in $excludecheck; do - excludecheck_opt="$excludecheck_opt --excludecheck $testsuite" - done - - # If there were extraconfig options, extract the - # corresponding repo - if test -n "$extraconfig" ; then - git clone http://git.linaro.org/toolchain/abe-extraconfigs.git - fi - - extraconfig_opt="" - for config in $extraconfig; do - case ${extraconfig} in - *=*) - tool=${extraconfig%=*} - value=${extraconfig#*=} - ;; - *) - echo ERROR: wrong extraconfig: $extraconfig - exit 1 - ;; - esac - extraconfig_opt="${extraconfig_opt} --extraconfig $tool=$PWD/abe-extraconfigs/$value" - done - - result="0" - - # Configure postfix - ${build_CONTAINER_RSH} "sudo sed -e s/@@MYHOSTNAME@@/${NODE_NAME}/g -e s/@@MAILHOST@@/email-smtp.us-east-1.amazonaws.com/ -e s/@@MAILPORT@@/587/ -i /etc/postfix/main.cf" - ${build_CONTAINER_RSH} "sudo sed -e s/@@MAILHOST@@/email-smtp.us-east-1.amazonaws.com/ -e s/@@MAILPORT@@/587/ -e s/@@MAILUSER@@/${TCWG_SES_USER}/ -e s/@@MAILPASSWORD@@/${TCWG_SES_PASSWORD}/ -i /etc/postfix/sasl_password" - ${build_CONTAINER_RSH} "echo linaro.org | sudo tee /etc/mailname" - ${build_CONTAINER_RSH} "sudo postmap hash:/etc/postfix/sasl_password" - ${build_CONTAINER_RSH} "sudo /etc/init.d/postfix start" - - ${build_CONTAINER_RSH} "cd ${WORKSPACE} && bash -x ${WORKSPACE}/jenkins-scripts/jenkins.sh --workspace ${WORKSPACE} --abedir ${WORKSPACE} --override \"$override\" $target_opt --languages ${languages} $bootstrap $runtests_opt $excludecheck_opt ${extraconfig_opt} ${send_results_to} --logserver $log_server $logname_opt $norebuild $options"|| result=$? - - # If the build failed, stop the containers, which will - # leave them as-is for ~10 days. - if [ $result -ne 0 ]; then - trap "stop_all_containers" EXIT - fi - - # If we actually built a toolchain, save its manifest. - # If the build was a no-op (results already present on log_server), - # copy the existing ones. - if [ -d _build/builds ]; then - manifest="`grep "^manifest=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-`" - else - manifest="" - fi - if [ x"${manifest}" != x ]; then - cp ${manifest} artifacts/ - else - # We need to do the same name expansion as jenkins.sh - eval dir="$log_name" - scp "$log_server/$dir/*manifest.txt" artifacts/ - fi - - # Provide requested binaries as artifacts - if $binaries; then - cp $(grep "^toolchain=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-) artifacts/ - cp $(grep "^toolchain_asc=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-) artifacts/ - cp $(grep "^runtime=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-) artifacts/ - cp $(grep "^runtime_asc=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-) artifacts/ - cp $(grep "^sysroot=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-) artifacts/ - cp $(grep "^sysroot_asc=" ${WORKSPACE}/build-artifacts.txt | cut -d = -f 2-) artifacts/ - fi - - # Save logs and their directory structure - rsync -a --exclude="/logs/" --include="*/" --include="*.log" --include="*.err" --include="*.out" --include="*.txt" --exclude="*" --prune-empty-dirs ./ ./logs/ - if ! tar -I pxz -cf ./artifacts/logs.tar.xz ./logs/ >/dev/null 2>&1; then - # PXZ can [rarely] fail due to high RAM usage, so fallback to normal XZ. - rm -f ./artifacts/logs.tar.xz - tar -cJf ./artifacts/logs.tar.xz ./logs/ - fi - - echo "Result of jenkins.sh: $result" - if $dont_fail; then - result="0" - fi - exit $result + ./jenkins-scripts/tcwg-buildfarm.sh publishers: - archive: artifacts: 'artifacts/*' |