fix: swap LAVA YAML template generation for broken jobs

This change introduces two new hooks:

- `generate_lava_job_template` is expected to generate the initial LAVA
  job YAML file (`job.yaml`), which may include fields which are not
  yet known
- `generate_lava_job` is used to fill in anything in the LAVA job that
  was not known when the job YAML file was generated

Previously, these were incorporated into other hooks almost
arbitrarily, and in some jobs this meant that they were invoked in the
wrong order. These new hooks allow us to be explicit about the order
that these operations occur.

Change-Id: I07f96b91a7ddb04b599ccca674797d4714296c21
Signed-off-by: Chris Kay <chris.kay@arm.com>
diff --git a/script/build_package.sh b/script/build_package.sh
index 7a4b3e7..214a875 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -1461,6 +1461,10 @@
 		call_hook fetch_tf_resource
 		call_hook post_fetch_tf_resource
 
+		# Generate LAVA job files if necessary
+		call_hook generate_lava_job_template
+		call_hook generate_lava_job
+
 		# Clear any local changes made by applied patches
 		undo_tf_patches