Reputation: 216
I want to change a js file and html file using release pipeline in VSTS. What I see is VSTS only allows JSON and XML config file transformation but I want to change other types(formats eg: .cs, .js, .ts, etc) of file as well.
Earlier we were using octopus deploy which has the option to transform these files.
Please let know if you know some other way to change the file in pipeline itself..
Upvotes: 1
Views: 887
Reputation: 76920
Can we change any file type using variable substitution rather than just JSON or XML
You could use Replace tokens
from the Marketplace:
https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens
to change other types files.
You define the desired values as variables in the Release Definition and then you add the Replace Tokens task and configure a wildcard path for all target text files in your repository where you want to replace values. The token that gets replaced has configurable prefix and postfix (default are #{
and }#
).
So, the format of variable in those files are #{TestVar}#
.
Check my other thread for some more details.
Update:
We do not want to use third party tools from marketplace, do we have any way within the scope of existing microsoft tools.
I am afraid there is no such directly existing Microsoft tools to change other types files at this moment, you could develop your powershell scripts to replace file content.
Check this thread for some more details.
Hope this helps.
Upvotes: 1