blob: 2fd9dbe03a958b0355b79edc0688c46723236b61 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
3# Copyright (c) 2019, Arm Limited. All rights reserved.
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8# THIS SCRIPT IS SOURCED!
9#
10# This script exists only to obtain a meaningful value for $CI_ROOT, the root
11# directory for CI scripts, from which other post-build scripts are executed.
12# Normally, $CI_ROOT *would* be available via. environment injection, but if a job
13# failed in its early stages, it wouldn't.
14
15# Although env file is meant to be sourced, RHS might have white spaces in it,
16# so sourcing will fail.
17if [ -f "$WORKSPACE/env" ]; then
18 source "$WORKSPACE/env" 2>/dev/null || true
19fi
20
21if [ -z "$CI_ROOT" ] && [ -d "$WORKSPACE/tf-a-ci" ]; then
22 CI_ROOT="$WORKSPACE/tf-a-ci"
23fi
24
25if [ -z "$CI_ROOT" ]; then
26 echo "warning: couldn't not determine value for \$CI_ROOT"
27fi