Report deploys to Atatus from Fabric
Call the following code from your deploy command when a deploy has completed successfully.
copy
import requests
def atatus_record_deploy():
api_key = 'YOUR_API_KEY_HERE'
release_stage = 'production'
user = local('whoami', capture=True)
# fetch last committed revision in the locally-checked out branch
revision = local('git log -n 1 --pretty=format:"%H"', capture=True)
resp = requests.post('https://api.atatus.com/v2/projects/:projectId/deployments', {
'api_key': api_key,
'revision': revision,
'release_stage': release_stage,
'user': user
}, timeout=3)
if resp.status_code == 200:
print "Deployment recorded successfully."
else:
print "Error recording deployment:", resp.text
Important:
To record deployments, you need to have an API key with the Write permission. You can create your API key from your account settings.