In jenkins job, create file using system groovy in current workspace

前端 未结 4 629
鱼传尺愫
鱼传尺愫 2020-12-08 10:41

my task is to collect node details and list them in certail format. I need to write data to a file and save it as csv file and attach it as artifacts. But i am not able to c

4条回答
  •  不知归路
    2020-12-08 11:28

    I suspect the error was caused by the path format, could you try below:

    change

    filename = envVars.get('WORKSPACE') + "\\node_details.txt";
    

    to

    filename = envVars.get('WORKSPACE') + "/node_details.txt";
    

    Because when I tried in my local jenkins server, I get it successfully executed.

    enter image description here

    enter image description here

提交回复
热议问题