Jenkins is a Java-built open-source Continuous Integration (CI) and Continuous Deployment (CD) platform. Basically, Jenkins builds software projects, checks and deploys them. This is one of the most practical programming tools you can master, and today we will show you how to install Jenkins on your macOS, and how to use this powerful tool to activate your VPS server. VPS copies a dedicated server environment in a shared server.
Jenkins is loved by teams of all sizes, for different language projects like Java, Ruby, Dot Net, PHP etc. Jenkins is a platform that is autonomous, and can be used on Windows, Mac or any other operating system.
In this article, we will learn how to install Jenkins on Mac OS.
To understand Jenkins, you will need to consider continuous integration (CI) and continuous delivery (CD):
Developers update the code regularly in the shared repository (such as GitHub or TFS). Improvements made in the source code are made at the end of the day together, making it difficult to identify the errors. To avoid this, Jenkins is used here.
Once a developer changes the repository, Jenkins will automatically enable the build and immediately warn you in the event of an error (Continuous Integration CI).
We can also automate the post-construction tests with Jenkins (unit test, success test, acceptance test). Jenkins will conduct these tests and produce a report whenever progress is achieved (Continuous Delivery CD).
Easy to use – simple, intuitive, and visually appealing user interface
Extensibility – Jenkins is highly versatile and easy to adapt to your requirements. With various functionalities, there are thousands of open-source Plugins.
Jenkins supports various version control systems, code indicators, notifiers, user interface adaptations, and more!
As a WAR archive and as an Installer package, Jenkins is distributed as a Homebrew package, an image in the Docker and as source code for the main operating systems. Most of the source code is in Java and contains several Groovy, Ruby, and Antlr files.
You can run the Jenkins WAR on a Java application server such as Tomcat on your own or as a servlet. In any event, the web user interface is created and calls to its REST API are accepted.
When you first run Jenkins, you create a long random password for the administrative user, which you may paste in your first webpage to unlock the installation.
We will be going to run multiple jobs on Jenkins, so we need some proper configurations.
The following list shows the minimum software requirements:
Java: Java Development Kit (JDK) or Java Runtime Environment (JRE).
Web Browser: Any browser such as Google Chrome, Mozilla Firefox, Microsoft Edge, Safari
Operating System: macOS
We will discuss two ways to install Jenkins on your macOS:
You can install Homebrew with the following command:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You can check the Homebrew installation using:
$ brew -–version
Skip to the next section if you have Java already installed on your system.
Being an open-source Java application, Jenkins requires the installation of OpenJDK 8 on your system. The apt repositories can directly access OpenJDK 8.
The installation of OpenJDK from standard repositories is recommended. Open and enter the following in the terminal window:
$ brew install java
After Homebrew has been installed, it is required to execute the command that downloads and installs the latest version of Jenkins' Long-Term Support (LTS).
$ brew install jenkins-lts
You can run the following command to start the Jenkins server finally.
$ brew services start jenkins-lts
The above command will start the Jenkins server soon.
The port will be 8080. You can check it by visiting Jenkins on its default 8080 port with your server domain name or IP address: http://localhost:8080/
The Unlock Jenkins screen displays the initial password's location:
Use the cat command to display the password:
$ cat <path you receive after visiting http://localhost:8080/>
In this case,
$ cat /Users/ijs/.jenkins/secrets/initialAdminPassword
Copy the 32-character password and paste it into the Administrator Password field, then click Continue.
We will discuss the steps to complete the setup process at the end in the section How to configure Jenkins?
It's pretty easy to install Docker on Mac. It has a file with the .dmg graphical installer. Docker Engine, CLI client, Compose, Kitematic and Docker Machine, provided for installation.
1. Download Docker from install docker desktop. You will get a .dmg file
2. Click on the .dmg file and it will ask you to move the Docker app to the Application Folder.
3. Once the Docker icon has been dragged to the Applications folder, double-click the Docker icon and you will be asked if you want to open the App. Click on yes, to open Docker installer.
4. Click on the Next button and after this, it will ask you to install tools and will ask your permissions to proceed:
5. Now, you will see the Docker icon on the toolbar, which means that Docker is starting on your system.
After installation and set-up of Docker, you can run the following command to install Jenkins:
$ docker run -p 8080:8080 -p 50000:50000 -v ~/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
This command will download Jenkins' current version of Long-Term Support (LTS) and spin a new Docker container. This might take time for installation.
You will be asked for the administrator password and you will also see the location where you can find it when you visit Jenkins on its default 8080 port with your server domain name or IP address: http://localhost:8080/
We can refer to the steps above for the location of the password.
After the installation of Jenkins, we have to configure Jenkins to make it ready.
Jenkins has many plugins that can integrate with open-source project. The next move requires the installation of suitable plugins as per your requirement. You can easily add or delete plugins later. As of now we can simply install the suggested plugins.
Jenkins is currently the leading open-source automation server for all types of development work with around 1600 plugins. These 1,600 plug-ins cover five fields: platforms, UI management, management of source code, and build management most commonly.
Now, you have to create an admin user account. Make sure you note down the username and password as they would be needed later.
The last step is to configure the URL for the server.
Click Save and Finish once you have confirmed the relevant information. A confirmation page will show you that "Jenkins is ready!"
Finally, click on Start using Jenkins and you will see a dashboard.
Run the following command to stop the Jenkins server:
$ brew services stop jenkins-lts
Run the following command to restart the server again:
$ brew services restart jenkins-lts
To stop Jenkins, go to the terminal window where the Docker container was started and enter command + C. This will stop the Docker container from running and also stop Jenkins.
If you need to restart Jenkins, execute the same command that you used while installing Jenkins.
Jenkins is an automation platform focused on servers and is usually concerned with security. Jenkins also requires add-ons for projects written in languages other than Java. These additional components normally bloat Jenkins. Follow the steps to see how to uninstall Jenkins on Mac when you're having trouble or notice that Jenkins doesn't work on Mac.
If you have installed Jenkins using Homebrew then you should run the following commands to uninstall Jenkins:
$ brew uninstall jenkins --force $ brew cleanup
Learn more about the core concepts of Jenkins Jobs, Pipelines, Distributed System, Plugins with Jenkins Certification Course.
Installing Jenkins on mac is very easy. Jenkins has a low learning curve and you can start to work with it as quickly as possible.
There are some popular alternatives to Jenkins. One of these tools is Zuul, which does not allow broken code to integrate into your main branch, with various gate configurations like inter-project testing, cross-project dependencies and testing in parallel.
In this tutorial, you have learnt to install Jenkins using the packages provided by the project. You have started the server, opened the firewall, and created an administrative user. You can now begin to explore Jenkins!
Your email address will not be published. Required fields are marked *