Jenkins: Difference between revisions

From Nasqueron Agora
 
Line 30: Line 30:
For SSH, there are:
For SSH, there are:
* [https://jenkins.io/doc/pipeline/steps/publish-over-ssh/#-sshpublisher-%20send%20build%20artifacts%20over%20ssh Publish over SSH]
* [https://jenkins.io/doc/pipeline/steps/publish-over-ssh/#-sshpublisher-%20send%20build%20artifacts%20over%20ssh Publish over SSH]
* [https://jenkins.io/doc/pipeline/steps/ssh-steps/ SSH Pipline Steps]
* [https://jenkins.io/doc/pipeline/steps/ssh-steps/ SSH Pipeline Steps]
* [https://jenkins.io/doc/pipeline/steps/ssh-agent/#-sshagent-%20ssh%20agent SSH Agent Plugin]
* [https://jenkins.io/doc/pipeline/steps/ssh-agent/#-sshagent-%20ssh%20agent SSH Agent Plugin]



Latest revision as of 20:06, 10 September 2024

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

To reload all jobs configuration files, this Groovy script works fine too: https://issues.jenkins.io/browse/JENKINS-28043

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.