Skip to content

Instantly share code, notes, and snippets.

@tpgxyz
Created September 8, 2015 17:32
Show Gist options
  • Save tpgxyz/517e29b52b2c368c0a1d to your computer and use it in GitHub Desktop.
Save tpgxyz/517e29b52b2c368c0a1d to your computer and use it in GitHub Desktop.
--- /usr/bin/abf 2015-05-05 14:47:17.000000000 +0000
+++ ./abf 2015-08-30 01:18:14.501908317 +0000
@@ -807,6 +807,21 @@
execute_command(cmd, print_to_stdout=True, exit_on_error=True)
log.info(_('Commited.'))
+### GITHUB && ABF
+ # get name of the git project
+ gp_name = subprocess.check_output(["basename `git rev-parse --show-toplevel`"], shell=True)
+ # strip it
+ p_name = gp_name.rstrip('\n')
+ # URI for external git repo
+ ext_uri = "git@github.com:OpenMandrivaAssociation/%s.git" % (p_name)
+ ext_cmd = ['git', 'remote', 'set-url', '--add', '--push', 'origin', ext_uri ]
+ execute_command(ext_cmd, print_to_stdout=True, exit_on_error=True)
+ # URI for ABF repo
+ abf_uri = "git@abf.io:openmandriva/%s.git" % (p_name)
+ abf_cmd = ['git', 'remote', 'set-url', '--add', '--push', 'origin', abf_uri ]
+ execute_command(abf_cmd, print_to_stdout=True, exit_on_error=True)
+### END
+ log.info(_('Set push url for github.com'))
cmd = ['git', 'push']
execute_command(cmd, print_to_stdout=True, exit_on_error=True)
log.info(_('Pushed'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment