Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial commit of complete rebasing of bot.
    Now uses envsetup from the android build system for certain
    calls and information about vendor/target/etc. This allows it
    to be much more scalable and portable to other vendors.

    Code is insanely messy right now, but I need to get some sort
    of commit history going on this, for my memories sake.
  • Loading branch information
KhasMek committed Feb 15, 2012
1 parent 7194a6c commit 93f49a5
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
upload
test.sh
71 changes: 38 additions & 33 deletions build_device.sh
@@ -1,44 +1,49 @@
#!/bin/bash

BUILD_ROOT=~/aokp
TARGET_VENDOR=$(echo $TARGET_PRODUCT | cut -f1 -d '_')
VER=$(cat vendor/$TARGET_VENDOR/products/common_versions.mk | grep "TARGET_PRODUCT" | cut -f3 -d '_' | cut -f1 -d ' ')
ZIP=$(find $(echo $ANDROID_PRODUCT_OUT) -maxdepth 1 -name $TARGET_VENDOR_*-squished.zip)
OUTD=$(echo $(cd ../test && pwd))
#ZIP=/home/khasmek/Android/AOKP/out/target/product/toro/aokp_toro_build-23-squished.zip

# $1 should be lunch combo
# $2 should be device name

BUILD=$(cat $BUILD_ROOT/vendor/aokp/products/common_versions.mk | grep "TARGET_PRODUCT" | cut -f3 -d '_' | cut -f1 -d ' ')
NAME=aokp_$2_$BUILD.zip

# build
BUILD_ROOT=`pwd`
cd $BUILD_ROOT
. build/envsetup.sh
lunch $1
#make -j`grep 'processor' /proc/cpuinfo | wc -l` otapackage
make -j9 otapackage bacon
ZIP=$(find $BUILD_ROOT/out/target/product/$2/ -maxdepth 1 -name aokp_$2*-squished.zip)
cp $ZIP /home/roman/upload/$NAME

make -j9 bacon
#ZIP=$(find $(echo $ANDROID_PRODUCT_OUT) -maxdepth 1 -name $TARGET_VENDOR_$2*-squished.zip)
#OUTD=$(echo $(cd ../test && pwd))
# clean out of previous zip
OUTZ=$(echo $TARGET_PRODUCT)_$VER.zip
rm -rf $OUTD/$OUTZ
#mkdir $OUTD
#NAME=aokp_$2_$BUILD.zip
cp $ZIP $OUTD/$OUTZ

# finish
echo "$2 build complete"

# md5sum list
cd $OUTD
#md5sum aokp_*
md5sum $OUTZ | cat >> md5sum
# upload
cd $BUILD_ROOT
cd ../upload

#
# this is kind of dirty nasty, but create directories, then upload
#

sftp goo <<EOF
mkdir ./roms_html/$2
quit
EOF

sftp inffy <<EOF
mkdir /home/teamkang/public_html/roms/$2
quit
EOF

sftp maddler <<EOF
mkdir /home/teamkang/www/$2
quit
EOF

rsync -avP -e "ssh" ./$NAME goo:/home/roman/roms_html/$2/$NAME &
rsync -avP -e "ssh" ./$NAME inffy:/home/teamkang/public_html/roms/$2/$NAME &
rsync -avP -e "ssh" ./$NAME maddler:/home/teamkang/www/$2/$NAME &
echo "checking on upload reference file"

BUILDBOT=$BUILD_ROOT/vendor/$TARGET_VENDOR/bot/
cd $BUILDBOT
if test -x upload ; then
echo "Upload file exists, executing now"
cp upload $OUTD
cd $OUTD
./upload $2 && rm upload
else
echo "No upload file found (or set to +x), build complete."
fi

cd $BUILT_ROOT
39 changes: 39 additions & 0 deletions build_device.sh.bak
@@ -0,0 +1,39 @@
#!/bin/bash

TARGET_VENDOR=$(echo $TARGET_PRODUCT | cut -f1 -d '_')
# this needs to be fixed
#VER=$(cat ../products/common_versions.mk | grep "TARGET_PRODUCT" | cut -f3 -d '_' | cut -f1 -d ' ')
VER=$(cat vendor/$TARGET_VENDOR/products/common_versions.mk | grep "TARGET_PRODUCT" | cut -f3 -d '_' | cut -f1 -d ' ')

# $1 should be lunch combo
# $2 should be device name

# build
BUILD_ROOT=`pwd`
cd $BUILD_ROOT
. build/envsetup.sh
lunch $1
#make -j`grep 'processor' /proc/cpuinfo | wc -l` otapackage
make -j9 bacon
ZIP=$(find $(echo $ANDROID_PRODUCT_OUT) -maxdepth 1 -name $TARGET_VENDOR_$2*-squished.zip)
OUTD=$(echo $(cd ../test && pwd))
rm -rf $OUTD
mkdir $OUTD
#NAME=aokp_$2_$BUILD.zip
cp $ZIP $OUTD/$(echo $TARGET_PRODUCT)_$VER.zip

# finish
echo "$2 build complete"
# upload
echo "checking on upload reference file"

BUILDBOT=vendor/$TARGET_VENDOR/bot/
cd $BUILDBOT
if test -x upload ; then
echo "Upload file exists, executing now"
cp upload $OUTD
cd $OUTD
./upload $2 && rm upload
else
echo "No upload file found (or set to +x), build complete."
fi
39 changes: 13 additions & 26 deletions deploy.sh
@@ -1,43 +1,30 @@
#!/bin/bash

BUILD_ROOT=~/aokp
BUILDBOT=~/buildbot

# setup folders
rm -R ../upload
mkdir ../upload
#OUTD=$(echo $(cd ../test && pwd))
#rm -R $OUTD
#mkdir $OUTD

# clean
BUILD_ROOT=`pwd`
echo "$BUILD_ROOT"
cd $BUILD_ROOT
repo sync
#repo sync
. build/envsetup.sh

if [ $1 = "clean" ]; then
if [ "$1" = "clean" ]; then
make clean
fi

#
# build_device <lunch combo> <device name>
#
cd $BUILDBOT
./build_device.sh 7 maguro
./build_device.sh 8 toro
./build_device.sh 5 crespo
./build_device.sh 6 crespo4g
./build_device.sh 9 p4wifi
./build_device.sh 10 tenderloin
./build_device.sh 11 vivow
./build_device.sh 12 p4
./build_device.sh 13 p4vzw
./build_device.sh 10 tenderloin
./build_device.sh 11 vivow
./build_device.sh 14 stingray
./build_device.sh 15 wingray
./build_device.sh 16 supersonic
./build_device.sh 17 inc
./build_device.sh 18 vzwtab
#cd $BUILDBOT
#./build_device.sh 8 toro
./vendor/aokp/bot/build_device.sh 8 toro
./vendor/aokp/bot/build_device.sh 9 p4wifi

cd ~/upload
#cd $OUTD

# done!
md5sum aokp_*
#md5sum aokp_*
10 changes: 10 additions & 0 deletions upload_example
@@ -0,0 +1,10 @@
#!/bin/bash
#
# this is kind of dirty nasty, but create directories, then upload
#

VER=$(cat ../AOKP/vendor/aokp/products/common_versions.mk | grep "TARGET_PRODUCT" | cut -f3 -d '_' | cut -f1 -d ' ')
NAME=aokp_$1_$VER.zip
mkdir -p ~/Android/test1/$1
cd ~/Android/test/
rsync -aHS ./$NAME ~/Android/test1/$1/$NAME &

0 comments on commit 93f49a5

Please sign in to comment.