Jenkins Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 147: Line 147:
====User Credentials Provider====
====User Credentials Provider====


Managed by the [[Jenkins Credentials Plugin#Overview|Credentials Plugin]].
Managed by the [[Jenkins Credentials Plugin#Overview|Credentials Plugin]]. Provides each user with a personal credential store. Credentials will be available to:
* Immediate operations performed by the user who defined the credentials.
* Jobs with credentials parameters when directly triggered by a user with the permission: Job/Build.
* Jobs running as the user and the user has the permission: Job/Build.


===Credential Store===
===Credential Store===

Revision as of 18:47, 24 April 2018

External

Internal

Agent

Agents to execute a build may be selected with a Label Expression, specified in the job configuration.

Docker Plugin Agent

Docker Plugin Agent

Label

Label Expressions

Slave

Job

Jobs can be created from the UI and they show up on the dashboard, in the main table. A job state is maintained in $JENKINS_HOME/jobs/<job-name>. The job directory contains a config.xml and a "builds" subdirectory, which contains build state. The state include links to "lastFailedBuild", "lastStableBuild", "lastSuccessfulBuild", "lastUnstableBuild" and "lastUnsuccessfulBuild".

A job can be configured with Jenkins -> job -> Configure.

A job's configuration contains the following:

  • General Configuration
  • Source Code Management configuration
  • Build Triggers
  • Build Environment
  • Build definition - usually a shell command.
  • Post-build actions.

Build

A build belongs to a job.

Items

Freestyle Project

Pipeline

https://jenkins.io/doc/book/pipeline/overview/

A Jenkins Pipeline is a suite of plugins that implement a continuous delivery pipeline. When integrated with OpenShift, the Jenkins Pipeline functionality provides the engine for OpenShift Pipeline builds. More details about OpenShift Jenkins pipeline are available here:

OpenShift Jenkins Pipelines

More details about the pipeline syntax are available here:

Jenkins Pipeline Syntax

Build Environment

OpenShift Jenkins Build Environment

Distributed Build

https://wiki.jenkins.io/display/JENKINS/Distributed+builds

Plugin

https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial

The list of installed plugins can be obtained on the console Jenkins -> Manage Jenkins -> Manage Plugins -> Installed.

Interesting Jenkins Plugins

Server Administration Concepts

Instance State

A Jenkins instance state consists of the following:

  • The WAR file
  • Plugins.
  • Settings
  • Build logs
  • Artifacts archives
  • Jobs

Everything mentioned above is stored under $JENKINS_HOME. It is sufficient to archive this directory to make a back up of the instance. Similarly, restoring the data is just replacing the contents of the JENKINS_HOME directory from a back up.

The WAR file is stored under ${JENKINS_HOME}/war. The location can be overridden with --webroot=<new-location>. The WAR is expanded during the startup sequence.

The plugins are stored under ${JENKINS_HOME}/plugins. The location can be overridden with --pluginroot =<new-location>.

Jenkins on Docker

Jenkins Docker Plugin

CLI

Jenkins CLI

Security

Credential Management

Credentials Plugin

Credentials Plugin

Credential Type

Username with Password

Docker Certificates Directory

Docker Host Certificate Authentication

SSH Username with Private Key

Secret File

Secret Text

Certificate

Credential Domain

Credential Provider

A credential provider connects Jenkins to an external credential vault.

BlueOcean Folder Credentials

Folder Credentials Provider

Jenkins Credentials Provider

Managed by the Credentials Plugin. Provides credentials from the root of Jenkins. Credentials will be available to:

  • Authentication: SYSTEM
  • Users with permission: Job/Configure

Credentials will be available in:

  • Global scoped credentials be available to all items within Jenkins.
  • System scoped credentials restricted to system level operations such as connecting build agents.

User Credentials Provider

Managed by the Credentials Plugin. Provides each user with a personal credential store. Credentials will be available to:

  • Immediate operations performed by the user who defined the credentials.
  • Jobs with credentials parameters when directly triggered by a user with the permission: Job/Build.
  • Jobs running as the user and the user has the permission: Job/Build.

Credential Store

GitHub Credentials