I have a config.yml
file that contains the following:
access_key: ACC_KEY
secret_key: SEC_KEY
Now I am trying to replace the ACC_KEY
and SEC_KEY
with the actual access_key
ans secret_key
.
I have a groovy method that executes a shell script as given below:
def update(){
return this.execCmd("'sed -i s/ACC_KEY/${access_token}/g; s/SEC_KEY/${secret_token}/g' /root/.config/config.yml")
}
Is there something wrong in the way I have specified the sed
command inside the method? Because, whenever I run my Jenkins job, I am able to fetch the values of ${access_token}
and ${secret_token}
however it is not replacing ACC_KEY and SEC_KEY with those values.