Welcome to our guide on using Jenkins as an immutable infrastructure tool. Whether you’re launching a new Jenkins instance or transitioning an existing one, our shared bootstrapper project simplifies the process significantly. In this article, we’ll explain how to get started, along with some troubleshooting tips. Let’s dive in!
Goals of the Jenkins Bootstrap Project
- Centralize scripts in a shared project for easier management.
- Allow other projects to use these scripts with readability and flexibility.
- Provide a standard bootstrapper across all projects for consistency.
Requirements
Before we begin, make sure you have the following:
- Mac OS X or Linux.
- GNU awk (install via Homebrew with
brew install gawkon Mac). - Recommended: More than two CPU cores and 6GB of RAM for optimal Jenkins performance.
- Optional: Tools like Docker and Vagrant for provisioning.
Getting Started
Here’s how to set up your Jenkins instance using the shared bootstrapper.
Creating a New Jenkins Instance
If you are installing Jenkins for the first time, follow these steps:
- Create a new repository:
- Bootstrap your new Jenkins version locally:
- Visit http://localhost:8080 and install your desired plugins, ensuring that you proceed as admin.
- Save your Jenkins version and plugins to your new repository:
mkdir my-project
cd my-project
git init
git submodule add https://github.com/samrocketman/jenkins-bootstrap-shared .jenkins-bootstrap-shared
git add -A
git commit -m "initial commit"
./jenkins_bootstrap.sh
./jenkins-bootstrap-shared/scripts/upgrade/upgrade_build_gradle.sh
git add -A
git commit -m "plugins are installed"
Importing an Existing Jenkins Instance
To transition from an existing Jenkins instance, here’s what to do:
- Follow the repository creation steps as shown above.
- Prepare authentication for your remote Jenkins instance:
- Import your remote Jenkins and plugin versions:
export NO_UPGRADE=1
export JENKINS_WEB=https://jenkins.example.com
export JENKINS_USER=your username
export JENKINS_PASSWORD
read -sp "Password: " JENKINS_PASSWORD
./jenkins-bootstrap-shared/scripts/upgrade/upgrade_build_gradle.sh
git add -A
git commit -m "plugins are installed"
Defining Custom Plugins
Create a custom-plugins.txt file to hard code plugins to specific versions if necessary. This is useful in situations where:
- Internal plugins need to be installed via Maven.
- Plugins not available in the Jenkins Update Center need to be added.
- Resolving groups for older plugin versions during existing instance imports is required.
Next Steps
Once your bootstrap repository is ready, customize the variables.gradle file to suit your setup. Then, consider tagging your repository as a release.
Common Gradle Tasks
Here are common Gradle tasks to manage your Jenkins instance:
clean– cleans the build directory and all bootstrap-related files.buildRpm,buildDeb,buildTar– create installation packages for different Linux distributions.packages– executes the build tasks for RPM, DEB, and TAR formats.getjenkins– downloads the latest Jenkins WAR file.getplugins– downloads Jenkins plugin HPI files to the designated directory.
Troubleshooting
If you encounter issues during your setup, consider the following tips:
- Verify system requirements such as CPU and RAM.
- Check network connectivity to your Jenkins instance.
- Ensure that necessary tools (like Docker or Vagrant) are correctly installed.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
With the guidelines provided in this blog, you should now be equipped to set up your Jenkins instance effectively. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

