blob: c0a716539103644bae3b84e4aa3b1f31ddb487d5 [file] [log] [blame]
Khasim Syed Mohammed430d5942021-08-09 21:26:15 +05301#!/usr/bin/env bash
2#
3# Copyright (c) 2021 Arm Limited. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8# Generate a YAML file in order to dispatch N1SDP 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/n1sdp_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/n1sdp-board-firmware_primary.zip"
23 else
24 echo "file://$workspace/artefacts/$bin_mode/n1sdp-board-firmware_primary.zip"
25 fi
26}
27
28recovery_img_url="${recovery_img_url:-$(get_recovery_image_url)}"
29
Chris Kay3d807882022-08-31 16:00:02 +010030expand_template "$(dirname "$0")/lava-templates/n1sdp-linux.yaml"