Maven Repository
kind: maven
On this page
source | condition | target |
---|---|---|
✔ | ✔ | ✗ |
Description
source
The maven "source" retrieves the latest version from a maven repository
condition
The maven "condition" tests if a version exist on a maven repository.
Parameters
Name | Type | Description | Required |
---|---|---|---|
artifactid | string | Specifies the maven artifact artifactID | |
groupid | string | Specifies the maven artifact groupID | |
repository | string | Specifies the maven repository name | |
url | string | Specifies the maven repository URL | |
version | string | Specifies the maven artifact version |
Note | Url can contain Basic Auth credentials following the standard notation: username:password@url |
Example
# updatecli.yaml
scms:
default:
kind: git
spec:
url: "git@github.com:olblak/charts.git"
branch: master
user: olblak
email: me@olblak.com
directory: "/home/olblak/Project/Jenkins-infra/charts"
sources:
default:
kind: maven
spec:
owner: "maven"
url: "repo.jenkins-ci.org"
repository: "releases"
groupID: "org.jenkins-ci.main"
artifactID: "jenkins-war"
transformers:
- addSuffix: "-jdk11"
conditions:
docker:
name: "Test Docker Image Published on Registry with the correct tag"
kind: "dockerImage"
spec:
image: "jenkins/jenkins"
imageTag:
name: "Test if jenkins/jenkins docker image used"
scmid: default
kind: yaml
spec:
file: "charts/jenkins/values.yaml"
key: "jenkins.master.image"
value: "jenkins/jenkins"
targets:
imageTag:
name: "jenkins/jenkins docker tag"
kind: yaml
scmid: default
spec:
file: "charts/jenkins/values.yaml"
key: "jenkins.master.imageTag"
What it says:
Sources
Retrieve the version from a Maven source for the artifactID "jenkins-war" from the group "org.jenkins-ci.org" in the repository "releases" located on "repo.jenkins-ci.org" ⇒ 2.264 Append "jdk11" to it ⇒ 2.264-jdk11
Conditions
Then it tests two conditions:
Do we have a docker image published on Dockerhub for the "jenkins/jenkins" using the tag "2.264-jdk11"? Yes, proceed, No then abort
Do we have a the key jenkins.master.image set to the value "jenkins/jenkins" from the file "charts/jenkins/values.yaml" located on the git repository "git@github.com:olblak/charts.git"? ⇒ Yes, proceed, No then abort
Targets
If conditions are all met then updatecli updates, if necessary, the key "jenkins.master.imageTag" to "2.264-jdk11" for the file "charts/jenkins/values.yaml" from the git repository "git@github.com:olblak/charts.git" then commit the change to the branch master.