[MediaWiki-commits] [Gerrit] Output the current time stamp to stdout and stderr - change (labs...wikipedia-android-builds)
Yuvipanda has submitted this change and it was merged. Change subject: Output the current time stamp to stdout and stderr .. Output the current time stamp to stdout and stderr Switched to print from future package for a good way to print to stderr. Change-Id: I14f47139c692c95defda99f9c4d22c4b88d55ccb --- M src/build.py 1 file changed, 9 insertions(+), 5 deletions(-) Approvals: BearND: Looks good to me, approved Yuvipanda: Verified diff --git a/src/build.py b/src/build.py index d0de362..ade1202 100755 --- a/src/build.py +++ b/src/build.py @@ -1,7 +1,9 @@ #!/data/project/wikipedia-android-builds/bin/python +from __future__ import print_function import os import sh import json +import sys from datetime import datetime # Environment variables required for Gradle to build app @@ -13,6 +15,10 @@ } REPO_PATH = os.path.expanduser('~/wikipedia') + +start = '== %s ==' % datetime.now().isoformat() +print(start, file=sys.stdout) +print(start, file=sys.stderr) sh.cd(REPO_PATH) sh.git('fetch') @@ -38,17 +44,15 @@ meta['commit_hash'] = commit_hash -# Clean out previous alpha folder -sh.rm('-rf', '~/wikipedia/wikipedia/src/main/java/org/wikipedia/alpha') +print('Starting build for %s, with %s new commits' % (commit_hash, commit_count), file=sys.stdout) -print 'Starting build for %s, with %s new commits' % (commit_hash, commit_count) sh.cd(REPO_PATH) gradle = sh.Command('./gradlew') gradle('-q', 'clean', 'assembleAlphaDebug', _env=env) sh.cp(sh.glob('wikipedia/build/outputs/apk/wikipedia-2.0-alpha-*.apk'), run_path) -print 'Finished build, output at %s' % run_path +print('Finished build, output at %s' % run_path, file=sys.stdout) meta['completed_on'] = datetime.now().isoformat() json.dump(meta, open(os.path.join(run_path, 'meta.json'), 'w')) @@ -57,4 +61,4 @@ sh.rm('-f', latest_path) sh.ln('-s', run_path, latest_path) else: -print 'No new commits' +print('No new commits', file=sys.stdout) -- To view, visit https://gerrit.wikimedia.org/r/165520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I14f47139c692c95defda99f9c4d22c4b88d55ccb Gerrit-PatchSet: 2 Gerrit-Project: labs/tools/wikipedia-android-builds Gerrit-Branch: master Gerrit-Owner: BearND bsitzm...@wikimedia.org Gerrit-Reviewer: BearND bsitzm...@wikimedia.org Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Output the current time stamp to stdout and stderr - change (labs...wikipedia-android-builds)
BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/165520 Change subject: Output the current time stamp to stdout and stderr .. Output the current time stamp to stdout and stderr Switched to print from future package for a good way to print to stderr. Change-Id: I14f47139c692c95defda99f9c4d22c4b88d55ccb --- M src/build.py 1 file changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikipedia-android-builds refs/changes/20/165520/1 diff --git a/src/build.py b/src/build.py index cdd3c70..c0134a7 100755 --- a/src/build.py +++ b/src/build.py @@ -1,7 +1,9 @@ #!/data/project/wikipedia-android-builds/bin/python +from __future__ import print_function import os import sh import json +import sys from datetime import datetime # Environment variables required for Gradle to build app @@ -13,6 +15,10 @@ } REPO_PATH = os.path.expanduser('~/wikipedia') + +start = '== %s ==' % datetime.now().isoformat() +print(start, file=sys.stdout) +print(start, file=sys.stderr) sh.cd(REPO_PATH) sh.git('fetch') @@ -38,14 +44,14 @@ meta['commit_hash'] = commit_hash -print 'Starting build for %s, with %s new commits' % (commit_hash, commit_count) +print('Starting build for %s, with %s new commits' % (commit_hash, commit_count), file=sys.stdout) sh.cd(REPO_PATH) gradle = sh.Command('./gradlew') gradle('-q', 'clean', 'assembleAlphaDebug', _env=env) sh.cp(sh.glob('wikipedia/build/outputs/apk/wikipedia-2.0-alpha-*.apk'), run_path) -print 'Finished build, output at %s' % run_path +print('Finished build, output at %s' % run_path, file=sys.stdout) meta['completed_on'] = datetime.now().isoformat() json.dump(meta, open(os.path.join(run_path, 'meta.json'), 'w')) @@ -54,4 +60,4 @@ sh.rm('-f', latest_path) sh.ln('-s', run_path, latest_path) else: -print 'No new commits' +print('No new commits', file=sys.stdout) -- To view, visit https://gerrit.wikimedia.org/r/165520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14f47139c692c95defda99f9c4d22c4b88d55ccb Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikipedia-android-builds Gerrit-Branch: master Gerrit-Owner: BearND bsitzm...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits