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 | [s][c][t] File defines the xml path to interact with | |
path | string | [s][c][t] Path defines the xmlPAth used for doing the query | |
value | string | [s][c][t] Value specifies the value for a specific Path. Default value fetch from source input |
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"