Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Config options
- export SRC_ROOT=/home/albinoman887/cm-12
- export TMP_UPLOAD=/home/albinoman887/tmp
- export WEB_ROOT=/var/www/html
- export MIRROR_ROOT=albinoman@download.chronic-buildbox.com:/home/albinoman/upload
- export MEGA_ROOT=/Root/html
- #######################################################################################
- export DEVICE="$1"
- export BUILD_TYPE="$2"
- export CURDATE=`date "+%m.%d.%Y"`
- function SetupDownloads()
- {
- cd $SRC_ROOT/out/target/product/$DEVICE/
- cp -r cm-12*.zip $TMP_UPLOAD/
- cd $TMP_UPLOAD
- cp -r cm-12*.zip $WEB_ROOT/$DEVICE/$BUILD_TYPE/
- scp cm-12*.zip $MIRROR_ROOT/
- ssh -t albinoman@download.chronic-buildbox.com "cd $MIRROR_ROOT ; cp -r cm-12*$DEVICE*.zip $WEB_ROOT/$DEVICE/$BUILD_TYPE/ ; rm -r cm-12*$DEVICE*.zip"
- megasync -l $WEB_ROOT/$DEVICE/$BUILD_TYPE -r $MEGA_ROOT/$DEVICE/$BUILD_TYPE
- rm -r cm-12*.zip
- cd $SRC_ROOT
- }
- #######################################################################################
- #Set device
- if [ "$1" = "" ]; then
- clear
- echo
- echo "No device set via cmdline, enter which device to build: "
- echo
- read DEVICE
- fi
- #Set build type
- if [ "$2" = "" ]; then
- clear
- echo
- echo "No build type set via cmdline, select build type (nightly/release/dev): "
- echo
- read BUILD_TYPE
- fi
- #print build config
- echo
- echo "Set DEVICE to: $DEVICE"
- echo "Set BUILD TYPE to: $BUILD_TYPE"
- echo
- #Get time
- time_start=$(date +%s.%N)
- # Copy builds
- SetupDownloads
- #Print total build time
- time_end=$(date +%s.%N)
- echo -e "${BLDYLW}Total time elapsed: ${TCTCLR}${TXTGRN}$(echo "($time_end - $time_start) / 60"|bc ) ${TXTYLW}minutes${TXTGRN} ($(echo "$time_end - $time_start"|bc ) ${TXTYLW}seconds) ${TXTCLR}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement