Jenkins: Difference between revisions

From Nasqueron Agora
(Plugins list)
(+Jenkins CLI, reload job)
Line 35: Line 35:


''Only plugins compatible with pipeline as code are presented in this section.''
''Only plugins compatible with pipeline as code are presented in this section.''
== Old-style jobs ==
Jobs configured without a Jenkinsfile could normally be configured through the UI. Some plugins are deprecated, and that breaks JS before you can handle the save/apply events.
As a workaround, you can edit the configuration file located in the jobs/ folder of Jenkins home, for example <code>/srv/jenkins/ci/jenkins_home/jobs/test-notifications-php/config.xml</code>.
Once done, changed can be applied through Jenkins CLI, e.g. <code>jenkins jenkins_ci reload-job test-notifications-php</code>
== Jenkins CLI ==
On the Docker engine where Jenkins run, use the <code>jenkins</code> wrapper to run Jenkins CLI through SSH:
<code>jenkins container_name command options</code>
For example:
<code>jenkins jenkins_ci reload-job test-notifications-php</code>
You need a SSH key associated to your Jenkins account.
[[Category:Resource]]
[[Category:Resource]]
[[Category:Reference]]
[[Category:Reference]]

Revision as of 23:04, 7 May 2022

We have a Jenkins instance located at http://ci.nasqueron.org and hosted as a Docker container on Dwellers.

Name conventions

<action verb>-<category>-<what>

Unit tests

We use test as action verb.

We suggest to use something like test-<repo callsign>[-subset of tests]

Deployment

We use deploy as action verb.

For *.nasqueron.org, we should use:

  • deploy-website-nasqueron-www1-<subdomain> for websites on Ysul (CNAME www1.nasqueron.org)
  • deploy-website-nasqueron-www3-<subdomain> for websites on Dwellers (CNAME www3.nasqueron.org)

Jenkinsfile

Plugins

The following plugins could be interesting when writing a pipeline:

For SSH, there are:


Only plugins compatible with pipeline as code are presented in this section.

Old-style jobs

Jobs configured without a Jenkinsfile could normally be configured through the UI. Some plugins are deprecated, and that breaks JS before you can handle the save/apply events.

As a workaround, you can edit the configuration file located in the jobs/ folder of Jenkins home, for example /srv/jenkins/ci/jenkins_home/jobs/test-notifications-php/config.xml.

Once done, changed can be applied through Jenkins CLI, e.g. jenkins jenkins_ci reload-job test-notifications-php

Jenkins CLI

On the Docker engine where Jenkins run, use the jenkins wrapper to run Jenkins CLI through SSH:

jenkins container_name command options

For example:

jenkins jenkins_ci reload-job test-notifications-php

You need a SSH key associated to your Jenkins account.