Issue when pushing with git in ignition 8.1 gateway event scrips

Im having an issue when pushing using the git-auto-commi.bat

The gateway event on save execute the script and does every steps but does not push, i have tried to do it in pyhton script or in a .bat file.

The issue is that when i use a script console the push line is executed but not on a gateway event

here is the code i used:
path="C:\Program Files\Inductive Automation\Ignition\data\projects"
gitpath="C:\Program Files\Git\cmd\git.exe"
import time
try:
logger = system.util.getLogger("myLogger")
system.util.execute([gitpath,"config","--global","user.name","'username"])
system.util.execute([gitpath,"config","--global","user.email","email@email.com"])
system.util.execute([gitpath,"config","--global","user.password","password"])
system.util.execute([gitpath,"-C",path,"add","."])
system.util.execute([path+"\git-auto-commit.bat"])
time.sleep(5)
dateStr=str(system.date.now())
system.util.execute([gitpath,"-C",path,"commit","-m","Designer save @ "+dateStr])
time.sleep(10)
system.util.execute([gitpath,"-C",path,"push origin"])
logger.info("git update done!")
except Exception as e:
logger.infof("error, errorMsg: \n",e)

And this the scripot from the .bat file:

cd "C:\Program Files\Inductive Automation\Ignition\data\projects
git config --global user.name "username"
git config --global user.email "email"
git config --global user.password "password"
git add .
git commit -m "Designer saved"
git push origin

In one call to system.util.execute(), your first argument is gitpath. In the other call (push), your first argument is path. Hmmm?

Yes, this is my mistake i have corrected it and i still have the issue

Pushing across a network likely requires the service to run under an account that isn't LOCAL_SYSTEM to have sufficient privileges. Consider using java's ProcessBuilder instead of system.util.execute() so you can recover the stdout and stderr of the process and inspect that output for errors. (You can also obtain git's result code, and for the working commit, use the process completion status to drive progress in your script instead of an evil .sleep() call.)

1 Like

Hello Andrew,

Did you managed to solve this problem? I am stuck in the same thing.

Thanks