liveBook · Manning

Jenkins job

As explained in Learn Docker in a Month of Lunches, Second Edition

A Jenkins job is a configured Jenkins task that executes specified automation, such as a build or pipeline.

A Jenkins job is a configured task that runs automation, such as a CI pipeline. In a containerized workflow, it can connect a Gogs repository to a Jenkinsfile, run pipeline stages, and show build status and logs. section 11.2

Create and use a Jenkins job through this practical workflow:

  • Create or select the repository that contains the application and Jenkinsfile. section 11.2
  • In Jenkins, click New Item and configure the job to use the appropriate Jenkinsfile path. section 11.6
  • Push changes to Gogs, or manually start a build from the job page. section 11.2
  • Inspect the build status, pipeline steps, and logs when a build fails; adjust the configuration and try again. section 11.6 section 11.2

Lab pipeline job

Create a job for the lab application by copying the existing diamol job configuration, changing the Jenkinsfile path from the exercises folder to the lab folder, and pushing the completed changes to Gogs. Expect an initial failure or two while checking logs and correcting the setup. section 11.6

# add registry domain to local hosts file on Mac or Linux:
sudo ./scripts/add-to-hosts.sh registry.local 127.0.0.1
# OR using PowerShell (run as admin)
./scripts/add-to-hosts.ps1 registry.local 127.0.0.1
# switch to infrastructure folder:
cd ch11/exercises/infrastructure
# start the app with Linux containers:
docker compose -f docker-compose.yml -f docker-compose-linux.yml up -d
# OR start with Windows Server containers:
docker compose -f docker-compose.yml -f docker-compose-windows.yml up -d
# check containers:
docker container ls

Use the infrastructure commands to start the containerized build environment, choose Linux or Windows container settings, and verify that the containers are running before opening Jenkins. section 11.2

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains job creation, Jenkinsfile selection, triggering, and failure checking, but does not detail Jenkins internals.
Examples
Uses a diamol job, a lab Jenkinsfile path, Gogs pushes, manual builds, pipeline steps, and failed-build logs.
What it assumes
Assumes familiarity with Docker Compose, Gogs repositories, Git pushes, and Jenkinsfiles while demonstrating the job setup itself.
What you can do after
Operate a Jenkins CI job by configuring its Jenkinsfile path, triggering builds, and diagnosing failures through logs.
How it connects
Connects Jenkins jobs with CI pipelines, Jenkinsfiles, Gogs repositories, Git pushes, and Docker Compose infrastructure.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.