#NEWLINE# def cmd_deploy( commit_msg ) : #NEWLINE# #INDENT# '\n    First build the website.\n\n    Next add changes to website repository, commit them and finally push to\n    remote origin.\n    ' #NEWLINE# cmd_build ( ) #NEWLINE# original_dir = os . getcwd ( ) #NEWLINE# os . chdir ( OUTPUT_DIR ) #NEWLINE# try : #NEWLINE# #INDENT# run_sys ( ( ( 'echo ' + CNAME_DOMAIN ) + ' > CNAME' ) ) #NEWLINE# res_git_add = run_sys ( 'git add -A' ) #NEWLINE# if ( res_git_add != 0 ) : #NEWLINE# #INDENT# raise ExceptDeploy ( "git add -A didn't work." ) #NEWLINE# #UNINDENT# commit_res = run_sys ( ( 'git commit -m "%s"' % commit_msg ) ) #NEWLINE# if ( commit_res != 0 ) : #NEWLINE# #INDENT# print ( 'Commit returned error code.' ) #NEWLINE# #UNINDENT# res_git_push = run_sys ( 'git push origin master' ) #NEWLINE# if ( res_git_push != 0 ) : #NEWLINE# #INDENT# raise ExceptDeploy ( "Git push origin master didn't work." ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# os . chdir ( commit_msg )