Created
February 22, 2015 23:12
-
-
Save legoktm/490e03e74dbeab0645fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
def shell_exec(args): | |
print(' '.join(args)) | |
return subprocess.check_output(args).decode() | |
jj = '/home/km/python/bin/jenkins-jobs' | |
jjb = '/home/km/projects/jenkins-job-builder' | |
conf = '/home/km/projects/integration-config' | |
os.chdir(conf) | |
out = shell_exec(['git', 'log', '--oneline', '-n', '1']) | |
testing_sha1 = out.split(' ', 1)[0] | |
os.chdir(jjb) | |
shell_exec([jj, 'test', 'config', '-o', 'output-proposed']) | |
os.chdir(conf) | |
shell_exec(['git', 'checkout', 'HEAD~1']) | |
os.chdir(jjb) | |
shell_exec([jj, 'test', 'config', '-o', 'output-parent']) | |
subprocess.call(['colordiff', '--new-file', '-u', 'output-parent', | |
'output-proposed']) | |
os.chdir(conf) | |
shell_exec(['git', 'checkout', testing_sha1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment