Closed ghost closed 4 years ago
It can replace with environment variables, e.g.: image: my-repository/my-image:${IMAGE_TAG}
Then you need to have defined the environmnet variable named IMAGE_TAG. I did this by calling: withEnv(['IMAGE_TAG='+ varName]) { kubernetesDeploy... } (see https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#withenv-set-environment-variables)
Thanks @BradNewton I found another alternative using content replace plugin https://wiki.jenkins.io/display/JENKINS/Content+Replace+Plugin
Is there any way to pass variables to yaml files such as pass an image tag?
Using something like this image: my-repository/my-image:${env.IMAGE_TAG}