Jenkins: Difference between revisions
(Created page with "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> === Un...") |
m (→Plugins) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
* deploy-website-nasqueron-www1-<subdomain> for websites on Ysul (CNAME www1.nasqueron.org) | * 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) | * 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: | |||
* [https://wiki.jenkins.io/display/JENKINS/Debian+Pbuilder+Plugin Build Debian package] (to deploy a software on Eglide for example) | |||
* [https://jenkins.io/doc/pipeline/steps/htmlpublisher/#-publishhtml-%20publish%20html%20reports Publish HTML reports] | |||
* [https://jenkins.io/doc/pipeline/steps/http_request/#-httprequest-%20perform%20an%20http%20request%20and%20return%20a%20response%20object Fire an HTTP request] | |||
* [https://jenkins.io/doc/pipeline/steps/rabbitmq-publisher/#-rabbitmqpublisher-%20publish%20to%20rabbit-mq Send a message to RabbitMQ] | |||
* [https://jenkins.io/doc/pipeline/steps/saltstack/#-salt-%20send%20a%20message%20to%20salt%20api Salt API] | |||
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/ssh-steps/ SSH Pipeline Steps] | |||
* [https://jenkins.io/doc/pipeline/steps/ssh-agent/#-sshagent-%20ssh%20agent SSH Agent Plugin] | |||
''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> | |||
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 <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]] |
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:
- Build Debian package (to deploy a software on Eglide for example)
- Publish HTML reports
- Fire an HTTP request
- Send a message to RabbitMQ
- Salt API
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.