aboutsummaryrefslogtreecommitdiff
path: root/utils/new-publish/propagate.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/new-publish/propagate.py')
-rwxr-xr-xutils/new-publish/propagate.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/new-publish/propagate.py b/utils/new-publish/propagate.py
index 6a9b166..e279e37 100755
--- a/utils/new-publish/propagate.py
+++ b/utils/new-publish/propagate.py
@@ -10,7 +10,7 @@ import paramiko
import publib
-REMOTE_HOST_PRODUCTION = "mombin.canonical.com"
+REMOTE_HOST_PRODUCTION = "snapshots.linaro.org"
REMOTE_HOST_STAGING = "staging.snapshots.linaro.org"
PUBLISH_USER_NAME = "linaro-android-build-publish"
TRIGGER_USER_NAME = "linaro-android-build-publish-trigger"
@@ -21,11 +21,12 @@ REMOTE_UPLOAD_DIR = "/uploads/android"
if __name__ == "__main__":
- optparser = optparse.OptionParser(usage="%prog")
+ optparser = optparse.OptionParser(usage="%prog <job/build>")
optparser.add_option("-s", "--staging", action="store_true", help="Publish to staging server")
optparser.add_option("--identity-publish", metavar="KEY", default=PUBLISH_KEY_FILE, help="Publish SSH key file")
optparser.add_option("--identity-trigger", metavar="KEY", default=TRIGGER_KEY_FILE, help="Trigger SSH key file")
optparser.add_option("-n", "--dry-run", action="store_true", help="Don't actually publish files, log commands")
+ optparser.add_option("--host", help="Override destination publishing host, for debugging")
optparser.add_option("--step", default="all", help="Run only specific step")
options, args = optparser.parse_args(sys.argv[1:])
if len(args) != 1:
@@ -33,12 +34,16 @@ if __name__ == "__main__":
publib.validate_build_id(args[0])
+ print "Starting propagation phase"
+
if options.staging:
remote_host = REMOTE_HOST_STAGING
opt_staging = "-s"
else:
remote_host = REMOTE_HOST_PRODUCTION
opt_staging = ""
+ if options.host:
+ remote_host = options.host
if options.step in ("all", "1"):
file_list = []
@@ -62,9 +67,11 @@ if __name__ == "__main__":
client.connect(remote_host, username=TRIGGER_USER_NAME, key_filename=TRIGGER_KEY_FILE)
stdin, stdout, stderr = client.exec_command("reshuffle-files -t android -j %s -n %s -m %s" % (job, build, opt_staging))
stdin.close()
+ rc = stdout.channel.recv_exit_status()
print "=== stdout ==="
print stdout.read()
print "=== stderr ==="
print stderr.read()
print "=============="
client.close()
+ sys.exit(rc)