yamlw
Extension on the Visual Studio Marketplace.
YouTube video of the VSTS YamlWriter task.
A package or command line to output YAML based on input parameters. Take build variables and write them to files.
Updates existing files or create them from scratch.
It will edit existing values and add new ones, including deep paths.
npm install yamlw
CLI Usage
This tool will wither create a non-existing file or edit and existing file. Use --dry-run
to not save the result - just print it on screen.
Given this original file
replicaCount: 1image: repository: jakkaj/sampletrainer tag: dev pullPolicy: IfNotPresentoutputs: modelfolder: /mnt/azure/ mountpath: /mnt/azurebuild: number: 1
yamlw -f samples/sample.yaml --set "build.number=23,something.else='my value'"
replicaCount: 1image: repository: jakkaj/sampletrainer tag: dev pullPolicy: IfNotPresentoutputs: modelfolder: /mnt/azure/ mountpath: /mnt/azurebuild: number: 23something: else: my value
Module Usage
var yamlwriter = ; var dry = true; //dry run, will not write filevar set = "build.number=23,something.else='my value'";;