dbaf203bb7411c770709697e6e345f698a832d77
[armband.git] / ci / deploy.sh
1 #!/bin/bash
2 #
3 # (c) 2016 Enea Software AB
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 set -e
11
12 export TERM="vt220"
13
14 cd $WORKSPACE
15 make patches-import
16
17 # source local environment variables
18 if ! [ -z $LAB_CONFIG_URL ]; then
19     while getopts "l:p:" OPTION 2>/dev/null
20     do
21         case $OPTION in
22             l) TARGET_LAB=$OPTARG;;
23             p) TARGET_POD=$OPTARG;;
24         esac
25     done
26     local_env=${LAB_CONFIG_URL}/labs/${TARGET_LAB}/${TARGET_POD}/fuel/config/local_env
27     # try to fetch this file, but don't create it if it does not exist.
28     # We add "|| true" to ignore the curl error when the file does not exist
29     echo "curl -s -f -O $local_env || true"
30     curl -s -f -O $local_env || true
31     local_env=$(basename $local_env)
32     if [ -e $local_env ]; then
33         echo "-- Sourcing local environment file"
34         source $local_env
35     fi
36 fi
37
38 cd upstream/fuel/ci
39 ./deploy.sh $@