Skip to content

Latest commit

 

History

History
83 lines (56 loc) · 2.83 KB

project_11.md

File metadata and controls

83 lines (56 loc) · 2.83 KB

Launch Jenkins

what is Jenkins

Jenkins is an open-source automation server that helps automate parts of the software development process. It is primarily used for continuous integration (CI) and continuous delivery (CD), which are practices that aim to improve the speed and quality of software development by automating the process of building, testing, and deploying code changes.

1. Create Security Group

First we will create a security group to allow ssh on port22 from any ip, allow http on port 80 and also custom port 8080 from any ip

2. Launch an instance

we will launch our instance to install jenkins on the server select existing security group we created and insert the scipt below in the user data


ec2

#!/bin/bash


#this updates and install dependencies: jdk and maven
sudo apt update
sudo apt install openjdk-11-jdk -y
sudo apt install maven -y

#gets link
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

#update and install jenkins
sudo apt-get update
sudo apt-get install jenkins -y

when the machine is up, you can always confirm what script is in the user data by running curl http://169.254.169.254/latest/user-data this will fetch the user data on your machine

this is the directory where jenkins files are stored once you confirm the successful installation of jenkins

sudo systemctl start jenkins
sudo systemctl enable jenkins
sudo systemctl status jenkins

validate

Now go to your browser and type the ip address of your machine on port 8080 you will see this


homepage

fill the form and save and continue to the dashboard


reg

welcome to jenkins dashboard, where majic hapens


dashboard

launch a build process for an app through freestyle project build

select a freestyle project for a start build

build

this is the workspace where jenkins store all the build files and artifacts build

here is the console to monitor the logs build