alias rsync="rsync --delete-after -az -e '$GIT_SSH'"

upstream_ssh="UPSTREAM_SSH"

# Build/update libs and run user pre_build and build
gear build

# Run tests here

# Deploy new build

# Stop app
$GIT_SSH $upstream_ssh 'gear stop --conditional'

# Push content back to application
rsync $WORKSPACE/ $upstream_ssh:~/app-root/repo/

# Configure / start app
$GIT_SSH $upstream_ssh 'gear remotedeploy'