From b8900db443e663c52ed5bac1c71510306586864c Mon Sep 17 00:00:00 2001 From: Lancy Norbert Fernandes Date: Sat, 30 Nov 2019 19:41:05 +1300 Subject: [PATCH] Created a sample script Created a sample script --- PSh.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 PSh.py diff --git a/PSh.py b/PSh.py new file mode 100644 index 0000000000..3a56d213c3 --- /dev/null +++ b/PSh.py @@ -0,0 +1,19 @@ +import subprocess + +# Set the command +command = "cd /Users/lancy/.jenkins/workspace/TryOutProject/; git log --pretty=format:%B -10" + +# Setup the module object +proc = subprocess.Popen(command, + shell=True, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + +# Communicate the command +stdout_value,stderr_value = proc.communicate() +str_list = filter(None, stdout_value.decode("ascii").splitlines()) +commitMessages = "
".join(str_list) +data = '{"release_notes" : \"'+commitMessages+'\"}' +print(data) +