try
This commit is contained in:
19
check_git.py
Normal file
19
check_git.py
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
import subprocess, os
|
||||
|
||||
def git_test(git_file=str, git_root=str):
|
||||
return subprocess.Popen(
|
||||
"git -C {git_root} log -1 --pretty=format:%h:%ct {git_file}".format(
|
||||
git_file=git_file,
|
||||
git_root=git_root),
|
||||
shell=True,
|
||||
universal_newlines=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
).communicate()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(git_test(git_file="/home/jonnybravo/Projekte/Python_Skripte/jenkins/use_jenkins_api.py", git_root="/home/jonnybravo/Projekte/Python_Skripte")[0])
|
||||
#git log -1 --pretty=format:%h:%c /home/jonnybravo/Projekte/Python_Skripte/jenkins/use_jenkins_api.py
|
||||
|
||||
0
ssh_with_sub/check_git.py
Normal file
0
ssh_with_sub/check_git.py
Normal file
16
test_skripte/check_git.py
Normal file
16
test_skripte/check_git.py
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
import subprocess, os
|
||||
|
||||
def git_test(git_file=str)
|
||||
return subprocess.Popen(
|
||||
'git log -1 --pretty=format:"%h:%c" {git_file}'.format(
|
||||
git_file=git_file ),
|
||||
shell=True,
|
||||
universal_newlines=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
).communicate()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(git_test=(git_file="/home/jonnybravo/Python_Skripte/jenkins-module.txt"))
|
||||
Reference in New Issue
Block a user