XML
kind: xml
On this page
source | condition | target |
---|---|---|
✔ | ✔ | ✔ |
Description
source
The XML "source" retrieves an information from a XML file using a XPATH query.
condition
The XML "condition" tests that an information exist in a XML file using a XPATH query.
target
The XML "target" ensures that a XML file content a specific value location in the XPATH location.
Parameters
Name | Type | Description | Required |
---|---|---|---|
file | string | “file” define the xml file path to interact with.
| |
path | string | “path” defines the xpath query used for retrieving value from a XML document
| |
value | string | “value” is the value associated with a xpath query.
|
Xpath
Under construction, some help would be need to document common xpath query that work with Updatecli https://www.w3.org/TR/1999/REC-xpath-19991116/
Example
# updatecli.yaml
name: Show a set of xml resources as a generic example
scms:
ircbot:
kind: git
spec:
url: https://github.com/olblak/ircbot.git
branch: master
sources:
parentVersion:
name: Get parent version from pom.xml
scmid: ircbot
kind: xml
spec:
file: pom.xml
path: "/project/parent/version"
conditions:
parent-version:
name: Test if parent version is set to source output
kind: xml
sourceid: parentVersion
scmid: ircbot
spec:
file: pom.xml
path: "/project/parent/version"
artifactid:
name: Test if parent artifactId is set to jenkins
kind: xml
scmid: ircbot
disablesourceinput: true
spec:
file: pom.xml
path: "/project/parent/artifactId"
value: "jenkins"
targets:
parent-version:
name: Test if parent version is set to source output
kind: xml
sourceid: parentVersion
scmid: ircbot
spec:
file: pom.xml
path: "/project/parent/version"
artifactid:
name: Test if parent artifactId is set to jenkins
kind: xml
scmid: ircbot
disablesourceinput: true
spec:
file: pom.xml
path: "/project/parent/artifactId"
value: "donotjenkins"