[Nexus S General] Andy:
Here is the script I use to do an automatic sync, build & upload to my site.

This is built on my machine then uploaded to my site.

Its not perfect, but it works everytime, assuming you can build without issues now.

What it does,

Repo syncs with -f (forced) & -j32 (16 or 32 concurrent downloads)

Clobbers

Builds with -j16 (my system has 8 cores so can handle the pressure, reduce this as necessary, also I build for the ace, be sure to change this)

Removes the old build from your system (no need to keep them locally if you upload them)

Moves them to a folder of your choice (currently ~/Dropbox/Public)

Renames them (CM7Unofficial-%TIME_%DATE_%MD5Hash) be sure to edit this to add in your build target - line 69

Uploads them to your webserver, via FTP using ncFTP. Be sure you have installed ncFTP and set it up & created the necessary folder on your webserver - line 80

Also you'd need to change,

The repo location - lines 9 & 50

The build target, mine is ace (Desire HD) - line 36

The output location - lines 43, 50, 53, 62 & 80

And you'd need to set up ncFTP.

I have added comments in for my own reference, but they should point you to the right location should you wish to modify it.

Sadly, other than helping you with this script, I cannot help you with setting up your build machine or anything related to build errors. Use search or Google.

Also remember these are not official builds and should not be named as such.

#!/bin/bash

## Simple script to automate building CM7.
## Script will repo sync, clobber, build, move, rename & upload via FTP
## All by invoking one command.

## Change into users CM7 repo - Assumes in users (~) dir.
echo "Changing Into Repo"
cd Development/Android/Gingerbread/
echo "Done"
echo ""
sleep 2
#
## Sync repo to check and download any new commits
## Added -f (force) flag to force a sync if errors or problems exist during sync.
## Added -j(32) flag to allow 32 simultaneous downloads.
#
echo "Syncing Repo"
repo sync -f -j32
echo ""
sleep 2
#
## Run a make clobber to remove all previous build files, this ensures a fresh build
## This step is not required and can be removed.
echo "Clobbering"
make clobber
echo "Hopefully Done"
sleep 3
#
## Finally the good part.
## -j16 flag can be altered to reflect the number of 'cores' your build machine has.
echo ""
echo "Bulding CM - Ace"
echo ""
. build/envsetup.sh
brunch ace -j16 && echo "Done - Build Success!" || echo "Build Failed - Check Output For Cause" finished
echo ""
#
## This deletes the old build
echo "Deleting Old Build"
sleep 2
echo ""
rm ~/Dropbox/Public/CM7* >/dev/null && echo "Successfully Deleted" || echo "No Build To Delete"
echo ""
sleep 2
#
## Moves new kang
#
echo "Moving New Build To Dropbox"
mv ~/Development/Android/Gingerbread/out/target/product/ace/*update*cm*.zip ~/Dropbox/Public
sleep 2
echo ""
[ -f ~/Dropbox/Public/*update*cm*DesireHD*.zip >/dev/null ] && echo "Successfully Moved" || echo "Error In Moving, check & try again"
echo ""
echo "Done, Enjoy"
cd ~
echo ""
#
## Script to Append Time & Date To Filename
## Change Into CM7 Kang Output Folder
#
cd Dropbox/Public/
# Copy
# Add Current Time & Date To Filename
#
MD5=$(md5sum update*)
TIME=$(date +%H%M_%d-%m-%Y)
MD5Only=${MD5:0:32}
mv update*.zip "CM7Unofficial-"$TIME"_$MD5Only.zip"
#
echo ""
echo "Renamed"
echo ""
#
# Script To Upload Kang To Website
# Begin FTP Commands
#
echo "Uploading"
echo ""
ncftpput -f ~/ncFTP/auth ./CM7-Unofficial/ ~/Dropbox/Public/CM7*
echo ""
echo ""
echo "Uploaded"
echo ""
function finished () { echo ""; }