Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 5673709830406144: Issue 356 - Publish uploaded devbuild on the Chrome Web Store (Closed)
Patch Set: Created May 5, 2014, 2:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .sitescripts.example ('k') | sitescripts/extensions/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/bin/createNightlies.py
===================================================================
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -393,7 +393,7 @@
# upload a new version with the Chrome Web Store API
# https://developer.chrome.com/webstore/using_webstore_api#uploadexisitng
- request = urllib2.Request('https://www.googleapis.com/upload/chromewebstore/v1.1/items/' + self.config.galleryID)
+ request = urllib2.Request('https://www.googleapis.com/upload/chromewebstore/v1.1/items/' + self.config.devbuildGalleryID)
request.get_method = lambda: 'PUT'
request.add_header('Authorization', '%s %s' % (response['token_type'], response['access_token']))
request.add_header('x-goog-api-version', '2')
@@ -413,6 +413,20 @@
if response['uploadState'] == 'FAILURE':
raise Exception(response['itemError'])
+ # publish the new version on the Chrome Web Store
+ # https://developer.chrome.com/webstore/using_webstore_api#publishpublic
+
+ request = urllib2.Request('https://www.googleapis.com/upload/chromewebstore/v1.1/items/%s/publish' % self.config.devbuildGalleryID)
+ request.get_method = lambda: 'POST'
+ request.add_header('Authorization', '%s %s' % (response['token_type'], response['access_token']))
+ request.add_header('x-goog-api-version', '2')
+ request.add_header('Content-Length', '0')
+
+ response = json.load(urllib2.urlopen(request))
+
+ if any(status != 'ITEM_PENDING_REVIEW' for status in response['status']):
+ raise Exception(response['statusDetail'])
+
def run(self):
"""
Run the nightly build process for one extension
« no previous file with comments | « .sitescripts.example ('k') | sitescripts/extensions/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld