aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-02-10 09:27:59 +0100
committerMartin Ridgers <[email protected]>2022-02-11 10:45:52 +0100
commit6e3faba03c8e951185ed92aeffb9f6aa2f67bc66 (patch)
tree58cc56d616bc73e5baebf603f51e76161a03a3d5 /scripts
parentFixed GCC non-conformant errors regarding "KeyData* KeyData;" (diff)
downloadzen-6e3faba03c8e951185ed92aeffb9f6aa2f67bc66.tar.xz
zen-6e3faba03c8e951185ed92aeffb9f6aa2f67bc66.zip
remote_build: build by commit instead of a remote/branch ref
Diffstat (limited to 'scripts')
-rw-r--r--scripts/remote_build.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/remote_build.py b/scripts/remote_build.py
index 5fd62b87f..71b8b500e 100644
--- a/scripts/remote_build.py
+++ b/scripts/remote_build.py
@@ -73,6 +73,7 @@ def _local(args):
parser = argparse.ArgumentParser(description=desc)
parser.add_argument("remotehost", help="")
parser.add_argument("action", default="build", nargs="?", help="")
+ parser.add_argument("--commit", default=None, help="Commit to act on")
parser.add_argument("--keyfile", default=None, help="SSH key file")
args = parser.parse_args(args)
@@ -156,6 +157,8 @@ def _local(args):
# Run this script on the remote machine
_header("Running SSH")
+ commit = args.commit if args.commit else "origin/main"
+
remote_zen_dir = "%s_%s" % (os.getlogin(), _get_ip())
print(f"Using zen '~/{remote_zen_dir}'")
@@ -166,7 +169,7 @@ def _local(args):
*identity,
"-tA",
host,
- f"python3 -u - !remote {_get_ip()} '{remote_zen_dir}' main '{args.action}'",
+ f"python3 -u - !remote {_get_ip()} '{remote_zen_dir}' {commit} '{args.action}'",
stdin=self_file)
# If we're bundling, collect zip files from the remote machine
@@ -187,7 +190,7 @@ def _remote(args):
parser = argparse.ArgumentParser(description=desc)
parser.add_argument("ip", help="Host's IP address")
parser.add_argument("reponame", help="Repository name clone into and work in")
- parser.add_argument("branch", help="Zen branch to operate on")
+ parser.add_argument("commit", help="Zen commit to operate on")
parser.add_argument("action", help="The action to do")
args = parser.parse_args(args)
@@ -211,7 +214,7 @@ def _remote(args):
_run_checked("git", "clean", "-fd")
_run_checked("git", "fetch", "origin")
- _run_checked("git", "checkout", "origin/" + args.branch)
+ _run_checked("git", "checkout", args.commit)
_header("REMOTE:", f"Performing action '{args.action}'")