# Automate with Jenkins<no value>
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4

== Description

Updatecli is most effective when executed regularly and automatically.

== Example
The current example is inspired by the repository https://github.com/jenkins-infra/charts[jenkins-infra/charts].

=== Requirement

* We assume using Jenkins with agent running from kubernetes using the https://plugins.jenkins.io/kubernetes/[kubernetes-plugin].
* We assume having access to credentials needed by your updatecli configurations which is "updatecli-github-token" in this case.

The Jenkins agent uses the updatecli docker image to execute updatecli every 30 minutes.
It applies the configurations found under the directory "./updatecli/updatecli.d" using the parameters in "./updatecli/values.yaml".

.Jenkinsfile
[source,groovy]
----
{{< include "assets/code_example/docs/automate/jenkins/Jenkinsfile" >}}
----

.PodTemplates.yaml
[source,yaml]
----
{{< include "assets/code_example/docs/automate/jenkins/podtemplates.yaml" >}}
----
