Setting up a Jenkins Build Farm
This repo contains step-by-step instructions how to install Jenkins and sample Pipelines for CI/CD (Continuous Integration and Continuous Delivery/Deployment).
🔧 1. Install the Jenkins Server
- For Docker execute:
docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts-jdk11 - For Linux Snaps execute:
sudo snap install --classic jenkins - Otherwise, download and install it from: https://jenkins.io/download (available for Arch Linux, FreeBSD, Gentoo, macOS, OpenBSD, OpenIndiana Hipster, openSUSE, Red Hat/Fedora/Alma/Rocky/CentOS, Ubuntu/Debian, Windows)
💻 2. Unlock the Jenkins Server
- Launch your Web browser and enter the URL: http://HOSTNAME:8080 (replace HOSTNAME by the computer name where Jenkins has been installed).
- Execute
sudo cat /PATH/TO/initialAdminPassword(replace /PATH/TO) to view the initial password saved by Jenkins during the installation. - Enter the initial password to unlock Jenkins.
📌 3. Install Jenkins Plugins
- Click on ‘Select plugins to install’
- Add these plugins: ‘Build Name and Description Setter’
- Click Install and wait until the installation has finished.
🧙♂️ 4. Create an Administrator Account
- Enter the username, password (twice), and the full name.
- Afterward, enter your Jenkins URL and log in.
📝 5. Create a Job
- In the dashboard click on: + Create element (on left side).
- Enter a job name (e.g. “sample-pipeline”) and select Pipeline, then press the OK button.
- The job configuration is displayed now - scroll down and select the Pipeline script.
- As script copy&paste the content of the Jenkinsfiles/sample.txt.
- Click the Save button.
▶️ 6. Start the Job
- Click on Dashboard (on left side).
- In your job list press the green Play button (on right side).
- The Stage View visualizes the whole build process in a neat table.
🏆 Congratulations
You’re all set. Welcome to the Jenkins ecosystem! More background information can be found here:
- Homepage at: https://www.jenkins.io
- User Documentation at: https://www.jenkins.io/doc
- Handbook at: https://www.jenkins.io/doc/book
🚀 What’s Next?
- Install the Jenkins app on your smartphone to trigger and watch builds anytime anywhere. It’s available for free at: https://play.google.com/store/apps/details?id=com.mobilabsolutions.jenkins.app
- Add jobs: see the sample Pipeline scripts in subfolder 📂Jenkinsfiles to build GitHub projects.
- Add user accounts: click Manage Jenkins > Users to create and manage user accounts.
- Add plugins: discover more than 2000(!) Jenkins plugins at: https://plugins.jenkins.io
- Add machines (called ‘nodes’) to extend your build farm. More information at: https://www.jenkins.io/doc/book/using/using-agents
- Add more automation, e.g. nightly builds and tests.
- Perform a backup: just zip the Jenkins home folder (at: /var/snap/jenkins or: .jenkins in your home directory) and copy it to another disk.
📜 License & Copyright
This open source project is licensed under the CC0 license. All trademarks are the property of their respective owners.