I have created symbolic links for bin and config directories to deployment folder as below:
/opt/app/bin -> /opt/deployments/v1/bin
/opt/app/config -> /opt/deployments/v1/config
I have a Python file as /opt/app/bin/pullfiles.py
. I have tried with below code to take abspath of pullfiles.py file:
import os
working_dir = f'{os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]}
It gives me below result:
/opt/deployments/v1
but I need actual result:
/opt/app