blob: d7946deaa12fab5a5d714c19625a89b3dcf434df [file] [log] [blame]
Fathi Boudra422bf772019-12-02 11:10:16 +02001#!/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
13ci_root="$(readlink -f "$(dirname "$0")/..")"
14source "$ci_root/utils.sh"
15source "$ci_root/juno_utils.sh"
16
17get_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
28bootloader_prompt="${bootloader_prompt:-juno#}"
29juno_revision="${juno_revision:-juno-r0}"
30recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}"
31nfs_rootfs="${nfs_rootfs:-$juno_rootfs_url}"
32linux_prompt="${linux_prompt:-root@(.*):~#}"
33
34cat <<EOF
35device_type: juno
36job_name: tf-juno
37
38context:
39 bootloader_prompt: $bootloader_prompt
40
41tags:
42- $juno_revision
43
44timeouts:
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
53priority: medium
54visibility: public
55
56actions:
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
88EOF