[meld] Fix Gitlab release tagging
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Fix Gitlab release tagging
- Date: Wed, 28 Mar 2018 00:06:24 +0000 (UTC)
commit 3aa85b48174b4403b349fc270cbe8132b7c854c4
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Mar 28 10:05:36 2018 +1000
Fix Gitlab release tagging
Look what you find when you run things in anger!
maint | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/maint b/maint
index aef45d79..e7462a74 100755
--- a/maint
+++ b/maint
@@ -2,7 +2,6 @@
import collections
import datetime
-import json
import os
import re
import subprocess
@@ -312,7 +311,7 @@ def gitlab_release_tag(tag):
id=GITLAB_PROJECT_ID)
)
- cmd = ['git', 'tag', '-l', "--format='%(contents)'", tag]
+ cmd = ['git', 'tag', '-l', "--format=%(contents)", tag]
description = subprocess.check_output(cmd).decode('utf-8')
endpoint = '{base}/projects/{id}/repository/tags/{tag_name}/release'
@@ -329,13 +328,18 @@ def gitlab_release_tag(tag):
# TODO: Should probably sanity-check that it's not already a
# release tag.
- requests.post(
+ response = requests.post(
release_url,
- data=json.dumps(release_data),
+ json=release_data,
headers={
'Private-Token': auth_token,
},
)
+ try:
+ response.raise_for_status()
+ except Exception as e:
+ click.secho(
+ 'Error making release: {}\n{}'.format(e, response.text), fg='red')
@click.group()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]