-
-
Save esseti/60a181a6e2471ad3e1c8f1ed0f99aabc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@runs_once | |
@task | |
def register_deployment(git_path, version=None): | |
# usualy is '.' if same folder | |
with(lcd(git_path)): | |
if not version: | |
version = current_tag() | |
url = "https://sentry.io/api/0/organizations/<YOUR_ORGANIZATION>/releases/" | |
revision = local('git log -n 1 --pretty="format:%H"', capture=True) | |
headers = {"Authorization": "Bearer %s" % django_settings.SENTRY_AUTH} | |
payload = dict(version=version, refs=[dict(repository='<YOUR_REPOSITORY>', commit=revision)], | |
projects=("<YOUT_PROJECT>",)) | |
res = requests.post(url, json=payload, headers=headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment