Jenkins: Installation and Creation of Freestyle Project – DZone DevOps | xxxJenkins: Installation and Creation of Freestyle Project – DZone DevOps – xxx
菜单

Jenkins: Installation and Creation of Freestyle Project – DZone DevOps

九月 4, 2019 - MorningStar

Over a million developers have joined DZone.
Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

{{announcement.body}}

{{announcement.title}}

Let’s be friends:

Jenkins: Installation and Creation of Freestyle Project

DZone ‘s Guide to

Jenkins: Installation and Creation of Freestyle Project

It’s pretty easy to get up and running with creating an instance of Jenkins and creating a freestyle project.

Free Resource

Join the DZone community and get the full member experience.

Join For Free

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Create a freestyle project with Jenkins.

Overview

Jenkins is a continuous integration server that can fetch the latest code from the version control system (VCS), build it, test it, and notify developers. Jenkins can do many things apart from just being a Continuous Integration (CI) server. Originally known as Hudson, Jenkins is an open-source project written by Kohsuke Kawaguchi. As Jenkins is a java based project, before installing and running Jenkins on your machine, first, you need to install Java 8.

You may also enjoy: Getting Started With Jenkins: The Ultimate Guide

Pre-Requisites

Before you proceed to install Jenkins in your Ubuntu machine, there are some prerequisites for Jenkins to install Jenkins.

  • Hardware Requirements: You need a minimum of 1 GB+ of RAM and 50 GB+ of drive space to install Jenkins.

  • Software Requirements: Java 8, either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) is fine

Note: This is not a requirement if running Jenkins as a Docker container.

Installing Jenkins

Login to Jenkins VM

1. Login to your Jenkins VM using putty.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Login with Putty

2. Update the packages:

sudo apt-get update

3. Install Java 8 Open JDK package.

sudo apt-get install openjdk-8-jdk 

4. Add the Jenkins Debian repository to the system

wget -q -O https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add - 

5. When the key is added, the system will return "OK." Next, we’ll append the Debian package repository address to the server’s sources.list:

echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list

6. Update the packages one more time.

sudo apt-get update

7. Finally, install the latest version of Jenkins with the following command.

sudo apt-get install jenkins -y 

8. After the installation process, the Jenkins service is automatically started. You can verify by typing the following command.

sudo service jenkins status 

Output should be like this:

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Service status

9. To set up your latest Jenkins installation, open your browser and browse the service hostname or IP address followed by port 8080. http://ip_address or domain.com:8080

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Unlock Jenkins

10. Open the command line and type the following command

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

11. Jenkins installer creates an initial 32-character alphanumeric password. Copy and paste it into the browser administrator password field, then click Continue.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Initial admin password

12. The setup wizard will ask you whether you want to install suggested plugins or you want to install specific plugins.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Suggested plugin

13. Click on the suggested plugins box, and the plugins installation process will start.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Getting started

14. Once the plugins are installed, you will be prompted to set up the first admin user. Fill out all required information and click Save and Continue.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Create first admin user

15. Next set the URL for your Jenkins instance. The URL will be generated automatically. Confirm the URL by clicking the Save and Finish button.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Instance configuration

16. Once all configurations are done, you can see the Jenkins is ready screen.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Start using Jenkins

17. Click Start using Jenkins and you will redirected to the Jenkins dashboard.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Dashboard

Create a Freestyle Project

Jenkins can be used to perform the builds on servers that work like regular builds and run tests and repetitive tasks.

1. Select New Item in the top left-hand corner on the dashboard.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

New item

2. Enter the name of your project in the Enter an item name field, and select Freestyle Project, and click OK button.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Freestyle project

3. Enter Description (optional).

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Description

4. Go to the Build section and click on the Add build step.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Add build step

5. Select Execute Shell as a build step.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Execute step

6. Copy and paste the following command into a command field.

date

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Command area

7. Click on Save, and it will redirect to the job’s view page.

8. On the left pane, click the Build Now button to execute your job.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Build now

9. We can verify the history of executed build under the Build History by clicking the build number.

Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Build history

10. Click on build number and select Console Output. Here you can see the outputs of executed commands.
Jenkins: Installation and Creation of Freestyle Project - DZone DevOps

Console output

Further Reading

Set Up Jenkins CI in 30 Minutes

Continuous Delivery With Jenkins Workflow

Topics:
jenkins tutorial ,jenkins ,jenkins job builder

Opinions expressed by DZone contributors are their own.

DevOps Partner Resources

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.linkDescription }}

{{ parent.urlSource.name }}

· {{ parent.articleDate | date:'MMM. dd, yyyy' }} {{ parent.linkDate | date:'MMM. dd, yyyy' }}


Notice: Undefined variable: canUpdate in /var/www/html/wordpress/wp-content/plugins/wp-autopost-pro/wp-autopost-function.php on line 51