I have a Python code that will run a script file.The script file will output the version tag of specific git repository.
My script file named 'start.sh' is as follows:
#!/bin/sh
git clone https://xxxxxxxxxx:x-oauth-basic@github.com/xxxxxxx/xxxxx.git
cd xxxxxxxx
git config --global user.email "xxxxxxxx"
git config --global user.name "xxxxxxxxx"
IMAGE_TAG=`echo \`git describe --tags\``
echo $IMAGE_TAG
My Python code is as follows:
import os
git_tag = os.popen('sh start.sh')
print(git_tag)
When I run the script file separately, it will return me the git tag. But, Whenever I try to print it in the Python code, it's not working.
How can I solve this issue?