def METHOD_NAME():
	# parse command line options
	try:
		opts, args = getopt.getopt(sys.argv[1:], '', ['credentials=', 'portal-properties=', 'rev=', 'host=', 'user='])
	except getopt.error, msg:
		print >> ERROR_FILE, msg
		usage()
		sys.exit(1)
    # process the options
	credentials = ''
	portal_properties = ''
	rev = ''
	host = ''
	user = ''
	for o, a in opts:
		if o == '--credentials':
			credentials = a
		elif o == '--portal-properties':
			portal_properties = a
		elif o == '--rev':
			rev = a
		elif o == '--host':
			host = a
		elif o == '--user':
			user = a
	if (credentials == '' or portal_properties == '' or rev == '' or host == '' or user == ''):
		usage()
		sys.exit(1)
    # check existence of credentials
	if not os.path.exists(credentials):
		print >> ERROR_FILE, 'credentials file does not exist: ' + credentials
		sys.exit(2)
    # check existence of portal properties
	if not os.path.exists(portal_properties):
		print >> ERROR_FILE, 'portal properties does not exist: ' + portal_properties
		sys.exit(2)
	# get portal credentials
	print >> OUTPUT_FILE, 'Reading credentials file: ' + credentials
	portal_credentials = get_portal_credentials(credentials)
	if not portal_credentials:
		print >> ERROR_FILE, 'Error reading %s, exiting' % credentials
		sys.exit(2)
	# lets update our portal repos to proper tag and build a new war
	print >> OUTPUT_FILE, 'Updating mercurial repository to rev: %s' % rev
	update_repos(rev)
	# build war
	print >> OUTPUT_FILE, 'Building war file using properties file:	%s' % portal_properties
	build_war(portal_credentials, portal_properties)
	# deploy
	print >> OUTPUT_FILE, 'Deploying war file to: %s@%s:%s' % (user, host, WAR_FILE_DEST)
	deploy_war(host, user)