I searched it, but I am not able to find any out-of-the-box task for a build pipeline of AzureDevOps to perform the following tasks;
- file rename (in my case it's a Javascript file)
- replace placeholder like the following: #placeholder# inside the renamed .js file
Is there something available out-of-the box to perform this tasks?
For first part you can call simply from powershell/script task and rename-item:
Or mv command and bash task.
For the second part you may use Token replace extension
so let's say you have file
create-container-instance.sh
and in yaml
and for that token
#{Image}#
is replaced byImage
variable.This is my pipeline:
Task group has task fro replacing tokens.
Here is variable declaration:
and token was replaced as expected:
If you want to use powershell to replace tokens you can try this
All credit goes to Tim Hobson