0

I have a Builflow with Groovy script. I cannot seem to be able to create a new file. The command does execute but I cannot see the file in my workspace.

First to create it in WORKSPACE I need to know where it is.

def WORKSPACE= build.environment.get("WORKSPACE")

Then define and create the file

def inputFile = new File(WORKSPACE + "/propfile")
new File(WORKSPACE + "/propfile")
Cher
  • 2,789
  • 10
  • 37
  • 64
  • 1
    Have you written anything to it? If you don't write anything to it, it's just a handle to a non-existent file, eg: `new File("${WORKSPACE}/propfile") << 'hello'` – tim_yates Jul 30 '15 at 15:18
  • thanks for the reply. I now do new File(WORKSPACE + "/propfile") << 'hello' which result in java.io.FileNotFoundException – Cher Jul 30 '15 at 15:27
  • So what does: `println new File("${WORKSPACE}/propfile").canonicalPath` show? Does that look ok? – tim_yates Jul 30 '15 at 15:48
  • yep, if I copy the path, I can access it on the slave directly – Cher Jul 30 '15 at 15:52

0 Answers0