Changed build/deploy scripts
authorAndriy Gudz <a.gudz@samsung.com>
Mon, 15 May 2017 14:58:18 +0000 (17:58 +0300)
committerAndriy Gudz <a.gudz@samsung.com>
Mon, 15 May 2017 14:58:18 +0000 (17:58 +0300)
device_core/scripts/.gitignore [new file with mode: 0644]
device_core/scripts/build-kantm.sh [deleted file]
device_core/scripts/build-tm1.sh [deleted file]
device_core/scripts/build-tm2.sh [deleted file]
device_core/scripts/build.sh
device_core/scripts/deploy-kantm.sh [deleted file]
device_core/scripts/deploy-tm1.sh [deleted file]
device_core/scripts/deploy-tm2.sh [deleted file]
device_core/scripts/deploy.sh

diff --git a/device_core/scripts/.gitignore b/device_core/scripts/.gitignore
new file mode 100644 (file)
index 0000000..9c5e689
--- /dev/null
@@ -0,0 +1 @@
+.device
\ No newline at end of file
diff --git a/device_core/scripts/build-kantm.sh b/device_core/scripts/build-kantm.sh
deleted file mode 100755 (executable)
index 7f0db96..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-
-${SCRIPT_DIR}/build.sh 2 $*
diff --git a/device_core/scripts/build-tm1.sh b/device_core/scripts/build-tm1.sh
deleted file mode 100755 (executable)
index f726007..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-
-${SCRIPT_DIR}/build.sh 1 $*
diff --git a/device_core/scripts/build-tm2.sh b/device_core/scripts/build-tm2.sh
deleted file mode 100755 (executable)
index 4da75c1..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-
-${SCRIPT_DIR}/build.sh 0 $*
index 783f9a2..d67afde 100755 (executable)
@@ -1,10 +1,41 @@
 #!/bin/bash
 
+SCRIPT_PATH=$(readlink -m ${0})
+SCRIPT_DIR=${SCRIPT_PATH%/*}
+ROOT_DIR=${SCRIPT_DIR}/..
+DEVICE_TEMP=${SCRIPT_DIR}/.device
+
 if [ -z "$1" ]; then
-       DEVICE=0
+       if [ ! -e "$DEVICE_TEMP" ] ; then
+           DEVICE=1
+       else
+               DEVICE=`cat $DEVICE_TEMP`
+       fi      
 else
        DEVICE=$1
 fi
+echo "$DEVICE" > $DEVICE_TEMP
+
+GREEN='\033[0;32m'
+NC='\033[0m'
+
+declare -a DEVICE_ARRAY=(
+"TM2 mobile"
+"TM1 mobile"
+"Kant TV"
+)
+
+arraylength=${#DEVICE_ARRAY[@]}
+for (( i=0; i<${arraylength}; i++ ));
+do
+       if [ $i -eq $DEVICE ]; then
+               echo -e "${GREEN}$i) ${DEVICE_ARRAY[$i]}${NC}"
+       else
+               echo "$i) ${DEVICE_ARRAY[$i]}"
+       fi
+done
+echo -e "\n\n"
+
 
 case $DEVICE in
        0) PROFILE=profile.tzmb_3.0_TM2 ; TARGET_ARCH=aarch64 ; GTEST_TYPE="main" ;;
@@ -13,9 +44,11 @@ case $DEVICE in
        ?) echo "error: unknown DEVICE number"; exit 1 ;;
 esac
 
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-ROOT_DIR=${SCRIPT_DIR}/..
+
+
+
+
+
 
 for ARG in $*
 do
@@ -30,7 +63,7 @@ cd $ROOT_DIR
 
 #init git repo for GBS
 git init
-git add .
+git add CMakeLists.txt
 git commit -m "commit needed for GBS"
 
 # trap ctrl-c and call ctrl_c()
diff --git a/device_core/scripts/deploy-kantm.sh b/device_core/scripts/deploy-kantm.sh
deleted file mode 100755 (executable)
index 2512ddd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-
-${SCRIPT_DIR}/deploy.sh 2 $*
diff --git a/device_core/scripts/deploy-tm1.sh b/device_core/scripts/deploy-tm1.sh
deleted file mode 100755 (executable)
index 7c297cf..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-
-${SCRIPT_DIR}/deploy.sh 1 $*
diff --git a/device_core/scripts/deploy-tm2.sh b/device_core/scripts/deploy-tm2.sh
deleted file mode 100755 (executable)
index 732fd32..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SCRIPT_PATH=$(readlink -m ${0})
-SCRIPT_DIR=${SCRIPT_PATH%/*}
-
-${SCRIPT_DIR}/deploy.sh 0 $*
index f8bd9f1..675d648 100755 (executable)
@@ -1,10 +1,39 @@
 #!/bin/bash
 
+SCRIPT_PATH=$(readlink -m ${0})
+SCRIPT_DIR=${SCRIPT_PATH%/*}
+DEVICE_TEMP=${SCRIPT_DIR}/.device
+
 if [ -z "$1" ]; then
-       DEVICE=0
+       if [ ! -e "$DEVICE_TEMP" ] ; then
+               DEVICE=1
+       else
+               DEVICE=`cat $DEVICE_TEMP`
+       fi
 else
        DEVICE=$1
 fi
+echo "$DEVICE" > $DEVICE_TEMP
+
+GREEN='\033[0;32m'
+NC='\033[0m'
+
+declare -a DEVICE_ARRAY=(
+"TM2 mobile"
+"TM1 mobile"
+"Kant TV"
+)
+
+arraylength=${#DEVICE_ARRAY[@]}
+for (( i=0; i<${arraylength}; i++ ));
+do
+       if [ $i -eq $DEVICE ]; then
+               echo -e "${GREEN}$i) ${DEVICE_ARRAY[$i]}${NC}"
+       else
+               echo "$i) ${DEVICE_ARRAY[$i]}"
+       fi
+done
+echo -e "\n\n"
 
 case $DEVICE in
        0) BUILD_ROOT=GBS_ROOT_3.0_TM2 ; PROFILE=tzmb_3.0_TM2 ; TARGET_ARCH=aarch64 ;;
@@ -13,8 +42,11 @@ case $DEVICE in
        ?) echo "error: unknown DEVICE number"; exit 1 ;;
 esac
 
-SCRIPT_PATH="$(readlink -m ${0})"
-CONTROL_DIR="${SCRIPT_PATH%/*/*}/scripts"
+
+
+
+
+
 
 GBS_RPMS_DIR=~/${BUILD_ROOT}/local/repos/${PROFILE}/${TARGET_ARCH}/RPMS