DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Jenkins: Installation and Creation of Freestyle Project

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.

Krishna Prasad Kalakodimi user avatar by
Krishna Prasad Kalakodimi
·
Oct. 28, 19 · Tutorial
Like (3)
Save
Tweet
Share
9.26K Views

Join the DZone community and get the full member experience.

Join For Free

freestyle

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.

Login with Putty

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:

service status

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

Unlock Jenkins

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.

Initial admin password

Initial admin password


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

Suggested plugin

Suggested plugin


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

Getting started

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.

Create first admin user

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.

Instance configuration

Instance configuration


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

Start Using Jenkins

Start using Jenkins


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

Dashboard

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.

New item

New item


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

Freestyle project

Freestyle project



3. Enter Description (optional).

description

Description


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

Add build step

Add build step


5. Select Execute Shell as a build step.

execute step

Execute step


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

date

Command area

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.

Build now

Build now


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

Build history

Build history


10. Click on build number and select Console Output. Here you can see the outputs of executed commands.
Console output

Console output

Further Reading


Set Up Jenkins CI in 30 Minutes


Continuous Delivery With Jenkins Workflow

Jenkins (software) Continuous Integration/Deployment

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Bye-Bye, Regular Dev [Comic]
  • ChatGPT: The Unexpected API Test Automation Help
  • What Should You Know About Graph Database’s Scalability?
  • Top Five Tools for AI-based Test Automation

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: