1 #!/bin/sh 2 # 3 # This script is used for the build server only. It installs the latest generated build of the Studio and calls 4 # other script to configure the automated tests environment and run the auto tests. 5 # It also copies the auto test scripts from the git repository to the directory that contains all the auto test dependencies. 6 # 7 # Source the properties: 8 . ./config.properties 9 10 echo "Initiating init_auto_tests.sh" 11 echo "Cleaning previous installation." 12 rm -rf $AUTO_TEST_TEMP_FILES 13 14 echo "Retrieving last generated installer." 15 LAST_LOG_WC=`ls -latr $BUILD_INSTALLERS |grep drw |tail -1|wc -m` 16 LAST_LOG_WC1=`echo "$LAST_LOG_WC-14" |bc` 17 LAST_LOG_WC2=`echo "$LAST_LOG_WC-1" |bc` 18 LAST_LOG=`ls -latr $BUILD_INSTALLERS |grep drw |tail -1|cut -c $LAST_LOG_WC1-$LAST_LOG_WC2` 19 LAST_BUILD_INSTALLERS=$BUILD_INSTALLERS/$LAST_LOG 20 echo "LAST_LOG_DIR=$LAST_BUILD_INSTALLERS" > lastlog.txt 21 fileName=$INSTALLER_NAME 22 fullFileName=$LAST_BUILD_INSTALLERS/$fileName 23 if [ ! -f $fullFileName ]; then 24 echo "Filename $fullFileName does not exists." 25 exit 1 26 fi 27 echo "Last installer found at: $fullFileName" 28 mkdir $AUTO_TEST_TEMP_FILES 29 cp $fullFileName $AUTO_TEST_TEMP_FILES 30 chmod 755 $AUTO_TEST_TEMP_FILES/$fileName 31 32 echo "Updating the properties file with the installation path." 33 echo $MOTODEV_INSTALLATION_PATH|sed "s/\//\\\\\//g" > $AUTO_TEST_TEMP_FILES/temp.txt 34 W=`tail -1 $AUTO_TEST_TEMP_FILES/temp.txt` 35 sed "s/MOTODEV_INSTALLATION_PATH/$W/" $SOURCE_BASE_PATH/install_properties.txt > $AUTO_TEST_TEMP_FILES/install_properties_aux.txt 36 37 echo "Installing MOTODEV Studio for Android at $MOTODEV_INSTALLATION_PATH" 38 java -jar $AUTO_TEST_TEMP_FILES/$fileName $AUTO_TEST_TEMP_FILES/install_properties_aux.txt 39 40 echo "Copying the scripts to the directory with all autotest dependencies." 41 #cp $SOURCE_BASE_PATH/init_auto_tests* $AUTO_TEST_SCRIPT_FILES/. 42 #cp $SOURCE_BASE_PATH/configure_start_auto_tests* $AUTO_TEST_SCRIPT_FILES/. 43 #cp $SOURCE_BASE_PATH/config.properties $AUTO_TEST_SCRIPT_FILES/. 44 #cp -rf $SOURCE_BASE_PATH/ant $AUTO_TEST_SCRIPT_FILES/. 45 46 cd $AUTO_TEST_SCRIPT_FILES 47 ./configure_start_auto_tests.sh 48