Rudziankoŭ
Rudziankoŭ

Reputation: 11251

Write file from Groovy using unix shell

I want to write file from groovy. I tried execute shell, but for some reason it doesn't work.

this_job_id = 43294;
"echo THIS_JOB_ID=${this_job_id.toString()} > build_groovy.properties".execute()

For some reason build_groovy.properties doesn't create

Upvotes: 1

Views: 923

Answers (1)

tim_yates
tim_yates

Reputation: 171054

Just write a file from groovy

new File('build_groovy.properties').text = "THIS_JOB_ID=$this_job_id"

Upvotes: 2

Related Questions