DevOps, Day - 23, 24 & 25

DevOps, Day - 23, 24 & 25

Jenkins Freestyle Project for DevOps Engineers.

ยท

3 min read

What is CI/CD?

CI (Continuous Integration) - Developers frequently combine their code changes into a shared repository and automatically test it to catch errors early and maintain code stability.

CD (Continuous Deployment) - Once the code passes integration tests, it is automatically deployed to production or staging environments, allowing for fast and reliable software updates.

What Is a Build Job?

A build job is a task that compiles and assembles source code into an executable or deployable artifact, typically as part of a software development pipeline or CI/CD process.

What is Freestyle Projects ?? ๐Ÿค”

Freestyle Projects refer to a type of project configuration in Jenkins, a popular automation server. It allows users to create customized and flexible build processes using a graphical interface, offering versatility and control over the build steps and configurations.


step 1: Launch an EC2 instance and connect it.

step 2: To proceed further, first make sure you have Java installed in your system.

Click To Install --> java

once done, check the version.

step 3: Now install Jenkins, go to the weekly release and execute the commands shown below in your terminal.

Check Jenkins status.

As we can see its HTTP port is 8080,

step 4: Now go to security grp in your AWS --> edit inbound rules-->add a rule to enable port 8080 so that it works in your IP.

Now we can see our Jenkins is running on our IP๐Ÿ”ฅ๐Ÿ”ฅ

After this plz refer to my previous blog on the installation process of Jenkins :)

Blog link--> Here

Once everything is ready, let's dive into our tasks ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ


Let's create a free-style project

step 1: Click on the new item.

step 2: Give a name, select freestyle and press ok.

step 3: Now provide the required info in respective fields.

step 4: Scroll down to the build steps, and add the below commands as shown...

step 5: save and check whether it's working!!

click on #5

SUCCESS๐Ÿ”ฅ


Now let's automate it...

step 6: Goto Configure and add the below commands in the build steps.

Build now and check the console output

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ

step 7: Enable the 8000 port by editing in ur inbound rules.

step 8: Now copy your IP and port number and check whether our app is working or not !!

It's working, Thank God๐Ÿ˜๐Ÿ˜

step 9: we can also see this in our local, type the docker ps command.


echo "Let's Continue further๐Ÿ˜๐Ÿ˜..."


CONTINUING OUR WORK .....

step 10: As we have our docker-compose file, something like this...

Next, go to configure and add the below commands in our build steps.

step 11: save and build now

step 12: Now check whether it's successful or not, by providing the correct IP and port number.

It worked, Thank God๐Ÿ˜๐Ÿ˜


[ How to Add Github Webhooks to a Jenkins Pipeline ] --> Link


Thank you so much for reading.

Follow me on LinkedIn to see interesting posts like this : )

Linkedin

ย