blob: 8d22ca6e25ecdcbfecc29c281560ae60c72648a2 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
Leonardo Sandoval579c7372020-10-23 15:23:32 -05003# Copyright (c) 2019-2020 Arm Limited. All rights reserved.
Fathi Boudra422bf772019-12-02 11:10:16 +02004#
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