How to replace a word in string in a yml configuration file

12/16/2020
flows:
  default:
    - log: "Starting the dev deployment of latest image."
    - log: '${imageTag}'

The ${imageTag} variable in the above yml configuration is printing the artifact Id with snapshot version (i.e.. 0.0.10-SNAPSHOT-199). But I would like to replace the version without snapshot in it (i.e.. 0.0.10-199 ). Basically I need to replace the string containing SNAPSHOT to empty string. Can someone help me with syntax. I tried different syntax which didn't worked like shown below.

flows:
  default:
    - log: "Starting the dev deployment of latest image."
    - log: '${imageTag}.replace("-SNAPSHOT", "")'
-- TechGeek
configuration
docker
kubernetes
yaml

0 Answers