Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: sky/tools/big_red_button.py

Issue 1233853006: Add a script for publishing an APK to the Play store. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/tools/publish_apk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/big_red_button.py
diff --git a/sky/tools/big_red_button.py b/sky/tools/big_red_button.py
old mode 100644
new mode 100755
index 75b246b62b9d520c04414996b1f867dd75919963..1ec803406274cbbde3c05d6df39022c17a4afdbf
--- a/sky/tools/big_red_button.py
+++ b/sky/tools/big_red_button.py
@@ -1,3 +1,8 @@
+#!/usr/bin/env python
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
# Prepare release script.
#
# 1) Bump versions:
@@ -18,24 +23,32 @@
# 4) Run this script.
#
-# Useful links:
-# http://stackoverflow.com/questions/14665518/api-to-automatically-upload-apk-to-google-play
-# https://developers.google.com/resources/api-libraries/documentation/androidpublisher/v2/python/latest/androidpublisher_v2.edits.apks.html
-
import argparse
import os
import subprocess
import sys
+import distutils.util
DEFAULT_MOJO_ROOT = '/src/mojo/src'
DEFAULT_SKY_SDK_ROOT = '/src/sky_sdk'
DEFAULT_DEMO_SITE_ROOT = '/src/domokit.github.io'
+CONFIRM_MESSAGE = """This tool is destructive and will revert your current branch to
+origin/master among other things. Are you sure you wish to continue?"""
+
def run(cwd, args):
print 'RUNNING:', ' '.join(args), 'IN:', cwd
subprocess.check_call(args, cwd=cwd)
+def confirm(prompt):
+ user_input = raw_input("%s (y/N) " % prompt)
+ try:
+ return distutils.util.strtobool(user_input) == 1
+ except ValueError:
+ return False
+
+
def main():
parser = argparse.ArgumentParser(description='Deploy!')
parser.add_argument('--mojo-root',
@@ -58,6 +71,10 @@ def main():
default=DEFAULT_DEMO_SITE_ROOT)
args = parser.parse_args()
+ if not confirm(CONFIRM_MESSAGE):
+ print "Aborted."
+ return 1
+
mojo_root = os.path.abspath(os.path.expanduser(args.mojo_root))
sky_sdk_root = os.path.abspath(os.path.expanduser(args.sky_sdk_root))
demo_site_root = os.path.abspath(os.path.expanduser(args.demo_site_root))
« no previous file with comments | « no previous file | sky/tools/publish_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698