Jenkins

Used as an open-source scheduler ..

Jenkins is an open-source automation server that enables developers to build, test, and deploy software efficiently. It's mainly used for Continuous Integration (CI) and Continuous Delivery (CD), automating the parts of software development related to building, testing, and deploying, facilitating continuous improvement and collaboration.

The following section is for Reference only.

Jenkins + plugins have been installed and configured.

Docker is a platform designed to help developers build, share, and run container applications.

Docker Compose is a tool for defining and running multi-container applications.

  1. Run update & upgrade (optional).

sudo apt update -y && sudo apt upgrade -y
  1. Create a Jenkins folder.

cd
mkdir ~/Jenkins
  1. Create docker-compose.yml

cd
cd ~/Jenkins
nano docker-compose.yml
services:
  jenkins:
    image: jenkins/jenkins:lts
    restart: always
    privileged: true
    user: root
    ports:
      - 9080:8080
      - 50000:50000
    container_name: jenkins-1
    volumes:
      - /home/pentaho/Jenkins/jenkins_configuration:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
image          — lts will download latest version.
ports          — defines ports: 9080 (www) and 50000 (api)
container_name — the name of our container: jenkins-1
volumes        — these are the virtual volumes used by the container. 
  1. Save.

CTRL + O
Enter
CTRL + X
  1. Create jenkins container.

cd
cd ~/Jenkins
sudo docker compose up -d
[+] Running 13/13
 ✔ jenkins Pulled                                                         10.3s 
   ✔ ca4e5d672725 Pull complete                                            4.1s 
   ✔ 5c2c33065c08 Pull complete                                            6.4s 
   ✔ 92488061783e Pull complete                                            6.6s 
   ✔ 283fc5f22098 Pull complete                                            6.6s 
   ✔ a9c4c37656d4 Pull complete                                            6.7s 
   ✔ ba8c648ced13 Pull complete                                            7.5s 
   ✔ 1cf1dfaee3c9 Pull complete                                            7.5s 
   ✔ 94f0d5472c4d Pull complete                                            7.6s 
   ✔ f8b0d06461dd Pull complete                                            8.5s 
   ✔ 43dde4536f7b Pull complete                                            8.6s 
   ✔ cdaf12c3ce9b Pull complete                                            8.6s 
   ✔ 70d4bec61dab Pull complete                                            8.6s 
[+] Running 2/2
 ✔ Network jenkins_default  Created                                        0.2s 
 ✔ Container jenkins-1        Started                                        3.6s 
  1. Verify the logs

sudo docker compose logs --follow
jenkins  | 2024-08-14 09:49:09.249+0000 [id=47]	INFO	jenkins.install.SetupWizard#init: 
jenkins  | 
jenkins  | *************************************************************
jenkins  | *************************************************************
jenkins  | *************************************************************
jenkins  | 
jenkins  | Jenkins initial setup is required. An admin user has been created and a password generated.
jenkins  | Please use the following password to proceed to installation:
jenkins  | 
jenkins  | 3d56d7ddc87c459ebaafe1117f7f56e7
jenkins  | 
jenkins  | This may also be found at: /var/jenkins_home/secrets/initialAdminPassword
jenkins  | 
jenkins  | *************************************************************
jenkins  | *************************************************************
jenkins  | *************************************************************
  1. Make a note of the password: 3d56d7ddc87c459ebaafe1117f7f56e7

  2. You can also retrieve the password with:

cd
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Configure Jenkins

  1. Access Jenkins UI.

  1. Copy and paste the password.

  1. Click 'Continue' & keep the default option 'Install suggested plugins'.

  1. Create Admin User.

Username

admin

Password

Welcome123!

Full name

system admin

  1. Save & Finish. You are now able to access Jenkins with the default admin account.

Last updated