LXA Cliff Notes — Jenkins Certified Engineer 2019: Jenkins 101
LXA Cliff Notes — Jenkins Certified Engineer 2019: Jenkins 101

integration — multiple merges back into master per day

delivery — forger merges; master is always ready to deploy.

deployment — delivery, but automated.

What’s a job?

Could be a:

freestyle job (most common, usually involves some bash script)

pipline (when freestyle isn’t enough)

multi-configuration (building stuff in multiple environments)

GitHub organization (part of a default plugin to make it easier to use scm)

multi-branch pipeline (when you branch, Jenkins will automatically make a project)

What’s a build?

Build is a single execution of a project.

Build step is a sub-task of that build.

Artifacts from build can be a) archived on master; and b) checked into scm for later use (why not artifact management repo?)

Build tools: plugins used for this. Defaults provided, e.g. Ant, Maven, shell scripting. Setup like this:

install plugin on Jenkins configure it globally include plugin on project configure it locally (.config, XML, POM)

What types of testing are there?

unit — is anything broken?

smoke — should further testing be done?

verification — does this meet spec?

functional — does this feature work?

integration — ???

acceptance — customer is happy

What’s a distributed build?

When builds occur outside master (on agents).

Why?

performance (parallelism) capacity (scaling) convenience (multi-configuration pipelines don’t compete)

Builds are sent to nodes based on tags.

Artifacts & test results go back to master, so master better be sizable.

SSH is how agents talk to master. JNLP also used.

Agents should be fungible (replaceable)!

Plugins

Jenkins builds software, but it’s designed to rely on plugins for extended functionality.

“Base Jenkins” = Jenkins + recommended plugins.

Plugin Manager = “App Store” for Jenkins. Gives you context, info on conflicts.

Rest API

Talk to it via /api on the server address.

Supports:

XML API

JSON API

Python API (2.6 or later)

Lets you:

build jobs ( curl http:// )

) check on the status of build queue (e.g. is master healthy?)

copy jobs! (e.g. if you have to create jobs based on a complex template)

[for Admins] restart Jenkins without SSH’ing into underlying infrastructure

Security

Security is about challenging:

Authentication — who are you?

— who are you? Authorization — what are you allowed to do?

Jenkins uses matrix security (i.e. based on sections & contexts)

“explicit allow model” — if not explicitly allowed, it’s denied.

set globally or project-based

or Inheritances is additive and will pass permissions from global → parent → job if inheritance is set

Types of inheritance for project-based security:

from parent don’t inherit from parent; just assume global permissions don’t inherit/assume any permissions

Auditing — Jenkins lets you track who uses what over time

Credentials

credentials — restricted resources, including agents

credentials provider — whatever serves creds to Jenkins process

Artifacts & Fingerprints

Artifacts are a common result of builds (or build steps), e.g.:

archive test results for CICD process

create classes (🤔)

archive a fully-compiled tar or war representing a version of an application

By default, they’re archived at /root/jobs/<build-name>/builds/lastSuccessfulBuild/archive on the Jenkins master.

Retention policies keep this directory from getting too bloated.

Fingerprints map builds to artifacts. They are:

globally-unique MD5 hashes

stored in /var/lib/jenkins/fingerprints

arranged in subfolders based on checksum (e.g. 38fhf47f44 would be in fingerprints/38/fh )

When you call for a fingerprint file via the API, you can see things like:
['Ford Prior']
['Jenkins']