Rfaulk has submitted this change and it was merged.

Change subject: add - definitions to default sync hook scripts.
......................................................................


add - definitions to default sync hook scripts.

Change-Id: I002c60afcbda41c851c41887d55d50f9be15cdf9
---
M sartoris/default-hooks/default-client-push.py
M sartoris/default-hooks/default-target-pull.py
2 files changed, 46 insertions(+), 6 deletions(-)

Approvals:
  Rfaulk: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sartoris/default-hooks/default-client-push.py 
b/sartoris/default-hooks/default-client-push.py
index f9fdd3f..0969e3e 100644
--- a/sartoris/default-hooks/default-client-push.py
+++ b/sartoris/default-hooks/default-client-push.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 """
 
@@ -11,15 +12,37 @@
 
 """
 
+import os
 import sys
+import subprocess
+
+from sartoris.config import GIT_CALL
 
 
-def main(args):
-    pass
+def main():
+
+    # Move to root - TODO, dulwich
+    proc = subprocess.Popen([GIT_CALL, 'rev-parse', '--show-toplevel'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE)
+    os.chdir(proc.communicate()[0].strip())
+
+    # Push to remote -  TODO, dulwich
+    #                   TODO, use git config for remote/branch
+    proc = subprocess.Popen([GIT_CALL, 'push', 'origin', 'master'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE)
+    proc.communicate()
+
+    # Push tags - TODO, dulwich
+    proc = subprocess.Popen([GIT_CALL, 'push', '--tags'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE)
+    proc.communicate()
 
 
 def cli():
-    sys.exit(main(sys.argv))
+    sys.exit(main())
 
 if __name__ == "__main__":  # pragma: nocover
     cli()
diff --git a/sartoris/default-hooks/default-target-pull.py 
b/sartoris/default-hooks/default-target-pull.py
index a78da38..3eefcf7 100644
--- a/sartoris/default-hooks/default-target-pull.py
+++ b/sartoris/default-hooks/default-target-pull.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 
 """
 
@@ -10,15 +11,31 @@
 
 """
 
+import os
 import sys
+import subprocess
+
+from sartoris.config import GIT_CALL
 
 
-def main(args):
-    pass
+def main():
+
+    # Move to root - TODO, dulwich
+    proc = subprocess.Popen([GIT_CALL, 'rev-parse', '--show-toplevel'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE)
+    os.chdir(proc.communicate()[0].strip())
+
+    # Pull from remote -    TODO, dulwich
+    #                       TODO, use git config for remote/branch
+    proc = subprocess.Popen([GIT_CALL, 'pull', 'origin', 'master'],
+                            stdout=subprocess.PIPE,
+                            stderr=subprocess.PIPE)
+    proc.communicate()
 
 
 def cli():
-    sys.exit(main(sys.argv))
+    sys.exit(main())
 
 if __name__ == "__main__":  # pragma: nocover
     cli()

-- 
To view, visit https://gerrit.wikimedia.org/r/83378
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I002c60afcbda41c851c41887d55d50f9be15cdf9
Gerrit-PatchSet: 1
Gerrit-Project: sartoris
Gerrit-Branch: master
Gerrit-Owner: Rfaulk <[email protected]>
Gerrit-Reviewer: Rfaulk <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to