Jenkins Freestyle Project for DevOps Engineers.

ยท

3 min read

Day-23 Task: Jenkins Freestyle Project for DevOps Engineers.

The Community is absolutely crushing it in the #90daysofdevops journey. Today's challenge is particularly exciting as it entails creating a Jenkins Freestyle Project, an opportunity for DevOps engineers to showcase their skills and push their limits. Who's ready to dive in and make it happen? ๐Ÿ˜

What is CI/CD?

  • CI or Continuous Integration is the practice of automating the integration of code changes from multiple developers into a single codebase. It is a software development practice where the developers commit their work frequently into the central code repository (Github or Stash). Then there are automated tools that build the newly committed code and do a code review, etc as required upon integration. The key goals of Continuous Integration are to find and address bugs quicker, make the process of integrating code across a team of developers easier, improve software quality and reduce the time it takes to release new feature updates.

  • CD or Continuous Delivery is carried out after Continuous Integration to make sure that we can release new changes to our customers quickly in an error-free way. This includes running integration and regression tests in the staging area (similar to the production environment) so that the final release is not broken in production. It ensures to automate the release process so that we have a release-ready product at all times and we can deploy our application at any point in time.

What Is a Build Job?

A Jenkins build job contains the configuration for automating a specific task or step in the application building process. These tasks include gathering dependencies, compiling, archiving, or transforming code, and testing and deploying code in different environments.

Jenkins supports several types of build jobs, such as freestyle projects, pipelines, multi-configuration projects, folders, multibranch pipelines, and organization folders.

What is Freestyle Projects ?? ๐Ÿค”

A freestyle project in Jenkins is a type of project that allows you to build, test, and deploy software using a variety of different options and configurations. Here are a few tasks that you could complete when working with a freestyle project in Jenkins:

Task-01

create an agent for your app.

step 1: Create a new instance in your AWS Account and give the instance name i.e. Pyare-Lal-Agent

Step 2: Install the java, docker and docker-compose

here is the code below required to install java, docker and docker-compose

sudo apt-get update

sudo apt-get install openjdk.11.jre

sudo apt-get install docker && sudo apt-get install docker-compose

Step 3: Permissions

$ sudo usermod -aG docker $USER && sudo usermod -aG docker jenkins

Step 4: Let's start to create a Jenkins Freestyle Project

We have already created Jenkins Master server instance on AWS in day 22 (also in hashnode day 22)

Step 1: go to your jenkins tools

Step 2: Follow the image to create a project

New Item

Enter an item name

Step 3: go to your repo in your github account or you can fork my repo.

https://github.com/manojdevopseng/django-todo-cicd.git

General

In General Section

Source Code Management

Make sure you are in the correct branch

Build and Run your code

echo "building your app"

docker build . -t django-app

echo "code successfully built"

docker run -d -p 8005:8005 django-app:latest

now save and build now

Step 4: Build Now

Your code is successfully build it.

Task -02Now build our code with Docker-Compose :)

Now check our app in browser, you need to put your ip address and port

yeahhhhhh.......

ย