I have a JSON called config.json and I would like to use the values it has to shit variables in a YML.
This is the format of the JSON
{
"config":
{
"ruta": "releases/package.xml",
"testLevel": "--testlevel NoTestRun",
"destroy": "false"
}
}
I need to get the value of "destroy" and load it into a variable in a YML.
Here I have a breakthrough and I need to use that variable in the next stage called "Validation" so that the condition is met.
stages:
- stage: LoadEnv
displayName: Load environment variables
jobs:
- job:
variables:
- name: DESTROY
value: false
steps:
- task: FileTransform@1
inputs:
folderPath: '$(System.DefaultWorkingDirectory)'
targetFiles: 'azure/config.json'
fileType: 'json'
- script: echo ${{variables.DESTROY}}
- stage: Validation
displayName: Validate environment
condition: eq( dependencies.LoadEnv.outputs['Load.variables.DESTROY'], 'false')
jobs:
- job: Validation
.......
I know things are missing but any help is welcome.