def pull_own_source_code_and_restart():
    with inDirectory(server_repository):
        previous_commit = last_commit()
text = git.pull()
current_commit = last_commit()
if previous_commit != current_commit:
    restart()
return 'Git says: {}'.format(text)
How to implement auto-update functionality for web application on multiple server?