I need Jenkins to run a shell script named create_environment.sh
including the following command:
sed -i '' "s~variable \"backendPoolID\" { default = \".*\"~variable \"backendPoolID\" { default = \"$backend_address_pool_id\"~g" var.tf
When I run the script inside the Jenkins
machine it works without a problem, but inside the Jenkins pipeline I get the Error:
sed: can't read s~variable "backendPoolID" { default = ".*"~variable "backendPoolID" { default = ""~g: No such file or directory
The pipeline step:
steps {
withCredentials([azureServicePrincipal('xxxx')]) {
dir("${WORKSPACE}/azure/terraform/deployment/${params.AZURE_ENV}") {
echo " *************************** Deploy /${params.AZURE_ENV} ***************************** "
sh "chmod 777 *"
sh "./create_environment.sh"
echo " *************************** Deploy erfolgreich ***************************** "
}
I already tried to replace sh "
with sh """
, but it didn´t helped.
Do anyone have some experience with that?