refactor: move LAVA job definition templates into independent files

This change introduces a new script function to expand the variables in
a file. With this, we can move the LAVA YAML job template descriptions,
which are currently embedded inside individual HEREDOCs, into their own
files.

Signed-off-by: Chris Kay <chris.kay@arm.com>
Change-Id: I09805ab4b6894a371e63a944d113ca2f475a806b
diff --git a/script/lava-templates/juno-linux.yaml b/script/lava-templates/juno-linux.yaml
new file mode 100644
index 0000000..8b4e449
--- /dev/null
+++ b/script/lava-templates/juno-linux.yaml
@@ -0,0 +1,53 @@
+device_type: juno
+job_name: tf-juno
+
+context:
+  bootloader_prompt: $bootloader_prompt
+
+$tags
+$juno_revision
+
+timeouts:
+  # Global timeout value for the whole job.
+  job:
+    minutes: 30
+  # Unless explicitly overwritten, no single action should take more than
+  # 10 minutes to complete.
+  action:
+    minutes: 10
+
+priority: medium
+visibility: public
+
+actions:
+
+- deploy:
+    namespace: recovery
+    to: vemsd
+    recovery_image:
+      url: $recovery_img_url
+      compression: zip
+
+- deploy:
+    namespace: target
+    to: nfs
+    os: debian
+    nfsrootfs:
+      url: $nfs_rootfs
+      compression: gz
+
+- boot:
+    # Drastically increase the timeout for the boot action because of the udev
+    # issues when using TF build config "juno-all-cpu-reset-ops".
+    # TODO: Should increase the timeout only for this TF build config, not all!
+    timeout:
+      minutes: 15
+    namespace: target
+    connection-namespace: recovery
+    method: u-boot
+    commands: norflash
+    auto-login:
+      login_prompt: 'login:'
+      username: root
+    prompts:
+    - $linux_prompt