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
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: 1
image:
repository: jakkaj/sampletrainer
tag: dev
pullPolicy: IfNotPresent
outputs:
modelfolder: /mnt/azure/
mountpath: /mnt/azure
build:
number: 1
yamlw -f samples/sample.yaml --set "build.number=23,something.else='my value'"
replicaCount: 1
image:
repository: jakkaj/sampletrainer
tag: dev
pullPolicy: IfNotPresent
outputs:
modelfolder: /mnt/azure/
mountpath: /mnt/azure
build:
number: 23
something:
else: my value
var yamlwriter = require('yamlw');
var dry = true; //dry run, will not write file
var set = "build.number=23,something.else='my value'";
yamlwriter('/path/to/file', dry, set);