Commit 4ef84b3c authored by Daniel Agar's avatar Daniel Agar

google play upload add release track arg

-set as beta for now
parent 3b25a5d3
......@@ -126,7 +126,7 @@ after_success:
- if [[ "${TRAVIS_OS_NAME}" = "android" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
pip install --user google-api-python-client PyOpenSSL
&& cd ${TRAVIS_BUILD_DIR} && openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in ${TRAVIS_BUILD_DIR}/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d
&& ${TRAVIS_BUILD_DIR}/tools/google_play_upload.py org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.apk
&& ${TRAVIS_BUILD_DIR}/tools/google_play_upload.py beta org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.apk
;
fi
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Uploads an apk to the beta track."""
"""Uploads an apk to the google play store."""
import argparse
......@@ -23,15 +23,16 @@ import httplib2
from oauth2client import client
from oauth2client.service_account import ServiceAccountCredentials
TRACK = 'beta' # Can be 'alpha', beta', 'production' or 'rollout'
JSON_KEY='android/Google_Play_Android_Developer-4432a3c4f5d1.json'
# Declare command-line flags.
argparser = argparse.ArgumentParser(add_help=False)
argparser.add_argument('package_name',
argparser.add_argument('release_track',
choices=['alpha', 'beta', 'production', 'rollout'],
help='Google play track. Can be alpha, beta, production or rollout')
argparser.add_argument('package_name',
help='The package name. Example: com.android.sample')
argparser.add_argument('apk_file',
nargs='?',
default='qgroundcontrol.apk',
help='The path to the APK file to upload.')
......@@ -51,10 +52,12 @@ def main():
# Process flags and read their values.
flags = argparser.parse_args()
release_track = flags.release_track
package_name = flags.package_name
apk_file = flags.apk_file
try:
print 'Uploading package %s to track %s' % (package_name, release_track)
edit_request = service.edits().insert(body={}, packageName=package_name)
result = edit_request.execute()
edit_id = result['id']
......@@ -68,7 +71,7 @@ def main():
track_response = service.edits().tracks().update(
editId=edit_id,
track=TRACK,
track=release_track,
packageName=package_name,
body={u'versionCodes': [apk_response['versionCode']]}).execute()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment