p/fuel: Upstream: MaaS: break infinite loops
[armband.git] / ci / deploy.sh
index 5f258c8..b81e5c8 100755 (executable)
@@ -9,12 +9,22 @@
 #
 set -e
 
-cd $WORKSPACE
-make submodules-init
+SCRIPT_DIR=$(readlink -f $(dirname ${BASH_SOURCE[0]}))
+
+export ARMBAND_BASE=$(readlink -e ${SCRIPT_DIR}/..)
+
+cd ${WORKSPACE:-${ARMBAND_BASE}}
 make patches-import
 
 # source local environment variables
 if ! [ -z $LAB_CONFIG_URL ]; then
+    while getopts "b:B:dfFl:L:p:s:S:T:i:he" 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
@@ -27,5 +37,6 @@ if ! [ -z $LAB_CONFIG_URL ]; then
     fi
 fi
 
+unset SSH_KEY
 cd upstream/fuel/ci
 ./deploy.sh $@