summaryrefslogtreecommitdiffstats
path: root/ci/deploy.sh
blob: dbaf203bb7411c770709697e6e345f698a832d77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#
# (c) 2016 Enea Software AB
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
set -e

export TERM="vt220"

cd $WORKSPACE
make patches-import

# source local environment variables
if ! [ -z $LAB_CONFIG_URL ]; then
    while getopts "l:p:" OPTION 2>/dev/null
    do
        case $OPTION in
            l) TARGET_LAB=$OPTARG;;
            p) TARGET_POD=$OPTARG;;
        esac
    done
    local_env=${LAB_CONFIG_URL}/labs/${TARGET_LAB}/${TARGET_POD}/fuel/config/local_env
    # try to fetch this file, but don't create it if it does not exist.
    # We add "|| true" to ignore the curl error when the file does not exist
    echo "curl -s -f -O $local_env || true"
    curl -s -f -O $local_env || true
    local_env=$(basename $local_env)
    if [ -e $local_env ]; then
        echo "-- Sourcing local environment file"
        source $local_env
    fi
fi

cd upstream/fuel/ci
./deploy.sh $@