0

I am running a Jenkins slave on a restricted environment. This environment will only allow me to execute files in a specific directory. The problem I have is running simple batch commands.

The slave's java.io.tmpdir being AppData/Local/Temp, jenkins will copy my command in a temp bat file and attempt to run it, like such:

cmd /c call D:\Users\TastyWithPasta\AppData\Local\Temp\hudson8090039221524722157.bat

Here the issue becomes obvious, the command cannot be run due to restriction and the build fails. Anybody working in a restricted environment and facing the same issues? What would be a good workaround?

Unfortunately, -Djava.io.tmpdir=newpath is not an option since this taps into the Java installation. Maybe there is a way to override it locally?

Michael Kemmerzell
  • 4,802
  • 4
  • 27
  • 43
  • 2
    Do you use a declarative pipeline (Jenkinsfile) and execute a simple batch command per 'bat'? – Michael Kemmerzell Feb 07 '19 at 18:21
  • Unfortunately no. I avoided using specific features to keep it scalable, as the server is old (.war 1.642.4). Pipelines are not even on the table. The goal is to isolate it as much as possible from the buildenv/testenv, relegating its involvement to running simple commands on fixed client environments. That being said, I remain open to any options that would allow to run commands on the clients. – Christophe Lionet Feb 07 '19 at 18:42

0 Answers0