Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (c) 2019, Arm Limited. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | # Generate a YAML file in order to dispatch Juno runs on LAVA. Note that this |
| 9 | # script would produce a meaningful output when run via. Jenkins |
| 10 | # |
| 11 | # $bin_mode must be set. This script outputs to STDOUT |
| 12 | |
| 13 | ci_root="$(readlink -f "$(dirname "$0")/..")" |
| 14 | source "$ci_root/utils.sh" |
| 15 | source "$ci_root/juno_utils.sh" |
| 16 | |
| 17 | get_recovery_image_url() { |
| 18 | local build_job="tf-build" |
| 19 | local bin_mode="${bin_mode:?}" |
| 20 | |
| 21 | if upon "$jenkins_run"; then |
| 22 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/juno_recovery.zip" |
| 23 | else |
| 24 | echo "file://$workspace/artefacts/$bin_mode/juno_recovery.zip" |
| 25 | fi |
| 26 | } |
| 27 | |
| 28 | bootloader_prompt="${bootloader_prompt:-juno#}" |
| 29 | juno_revision="${juno_revision:-juno-r0}" |
| 30 | recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}" |
| 31 | nfs_rootfs="${nfs_rootfs:-$juno_rootfs_url}" |
| 32 | linux_prompt="${linux_prompt:-root@(.*):~#}" |
| 33 | |
| 34 | cat <<EOF |
| 35 | device_type: juno |
| 36 | job_name: tf-juno |
| 37 | |
| 38 | context: |
| 39 | bootloader_prompt: $bootloader_prompt |
| 40 | |
| 41 | tags: |
| 42 | - $juno_revision |
| 43 | |
| 44 | timeouts: |
| 45 | # Global timeout value for the whole job. |
| 46 | job: |
| 47 | minutes: 30 |
| 48 | # Unless explicitly overwritten, no single action should take more than |
| 49 | # 10 minutes to complete. |
| 50 | action: |
| 51 | minutes: 10 |
| 52 | |
| 53 | priority: medium |
| 54 | visibility: public |
| 55 | |
| 56 | actions: |
| 57 | |
| 58 | - deploy: |
| 59 | namespace: recovery |
| 60 | to: vemsd |
| 61 | recovery_image: |
| 62 | url: $recovery_img_url |
| 63 | compression: zip |
| 64 | |
| 65 | - deploy: |
| 66 | namespace: target |
| 67 | to: nfs |
| 68 | os: debian |
| 69 | nfsrootfs: |
| 70 | url: $nfs_rootfs |
| 71 | compression: gz |
| 72 | |
| 73 | - boot: |
| 74 | # Drastically increase the timeout for the boot action because of the udev |
| 75 | # issues when using TF build config "juno-all-cpu-reset-ops". |
| 76 | # TODO: Should increase the timeout only for this TF build config, not all! |
| 77 | timeout: |
| 78 | minutes: 15 |
| 79 | namespace: target |
| 80 | connection-namespace: recovery |
| 81 | method: u-boot |
| 82 | commands: norflash |
| 83 | auto-login: |
| 84 | login_prompt: 'login:' |
| 85 | username: root |
| 86 | prompts: |
| 87 | - $linux_prompt |
| 88 | EOF |