Skip to content

Instantly share code, notes, and snippets.

@benjamingwynn
Created May 1, 2012 19:01
Show Gist options
  • Save benjamingwynn/2570511 to your computer and use it in GitHub Desktop.
Save benjamingwynn/2570511 to your computer and use it in GitHub Desktop.
A simple build/upload script
## WARNING! You must do the following pre-hand: sudo apt-get install ncftp
#
# set FTP information
#- name of ftp server
FTP_HOST=goo.im
#- username for ftp server
FTP_LOGIN=<insert username>
#- password of ftp server
FTP_PASSWORD=<insert password>
# start script
clear
echo -n
echo a.m.y. .s.h
echo -n
echo devloped by benjamingwynn
echo ==========================================
echo -n
echo ##########################################
echo Please type anything you wish to note on
echo this build. If you do not want to specify
echo anything then just hit enter.
echo -n
echo -n
echo -n "Notes on build : "
read opt
echo -n
echo The system will now run automatically...
echo ##########################################
sleep 2
clear
echo STARTING BUILD IN
echo -n
echo 10 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 09 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 08 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 07 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 06 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 05 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 04 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 03 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 02 seconds
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo STARTING BUILD IN
echo -n
echo 01 second
echo -n
echo IF YOU WISH TO CANCEL THE BUILD THEN PLEASE HIT CTRL+C NOW
sleep 1
clear
echo ==========================================
echo begining cyanogenmod 9 build
echo ==========================================
echo setting build notes correctly
BUILDDETAILS=$opt
if [ "$BUILDDETAILS" == "" ]; then
BUILDDETAILS='No comment given - standard amy.sh nightly build'
fi
echo ==========================================
echo setting up hostname note
if [ "$HOSTNAME" == "Amy" ]; then
HOSTNAMEINFO='Used amy.sh on Amy. Everything should be fine.'
else
HOSTNAMEINFO='WARNING: Did not use a known host for this build! Take caution!'
fi
if [ "$HOSTNAME" == "May" ]; then
HOSTNAMEINFO='Used amy.sh on May. Everything should be fine.'
fi
if [ "$HOSTNAME" == "dudemanscomputernamehere" ]; then
HOSTNAMEINFO='WARNING: Could not use Amy or May, used dudeman1996s PC with amy.sh instead.'
fi
# echo ==========================================
# echo navigating to builds folder
# cd ~/cyanogenmod/system/out/target/product
# echo ==========================================
# echo removing old build files
# rm -rf marvel
echo ==========================================
echo navigating to working dir
cd ~/cyanogenmod/system
echo ==========================================
echo preparing to sync with repos
repo sync
echo ==========================================
echo changing source
source build/envsetup.sh
echo ==========================================
echo selecting to build CM9
lunch cm_marvel-eng
echo ==========================================
echo enabling ccahce
export USE_CCACHE=1
echo ==========================================
echo building CM9
make -j8 bacon
echo ==========================================
echo navigating to builds folder
cd ~/cyanogenmod/system/out/target/product/marvel
echo ==========================================
echo setting date
BUILDDATE=$(date +"%d-%m-%Y")
echo ==========================================
echo writing buildlog
(echo $BUILDDATE: built by $USERNAME on $HOSTNAME [$HOSTNAMEINFO] - $BUILDDETAILS) >> BuildLog.txt
echo ==========================================
echo prepare ncftp transfers
ncftp <<EOF
echo ==========================================
echo connect to goo.im
open -u $FTP_LOGIN -p $FTP_PASSWORD $FTP_HOST
echo ==========================================
echo enter folder at goo.im
cd public_html
cd cm9_builds_bad
echo ==========================================
echo moving ota zip and date stamping
put cm_marvel-ota-eng.$USERNAME.zip
rename cm_marvel-ota-eng.$USERNAME.zip $BUILDDATE-cm_marvel-ota-eng.$USERNAME.zip
echo ==========================================
echo change folder to final zips
cd
cd public_html
cd cm9_builds
echo ==========================================
echo moving and datestamping final zip
put update-cm-9.0.0-RC0-marvel-UNOFFICIAL-signed.zip
rename update-cm-9.0.0-RC0-marvel-UNOFFICIAL-signed.zip $BUILDDATE-update-cm-9.0.0-RC0-marvel-UNOFFICIAL-signed.zip
echo ==========================================
echo posting build log
delete BuildLog.txt
put BuildLog.txt
echo ==========================================
echo disconnecting from goo.im
bye
EOF
echo =========================================================================
echo amy.sh has now cleaned, grabbed, compiled, uploaded and logged everything
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment