Saturday, May 16, 2020

Shell script for setting up Jenkins in Ubuntu instance | Setup Jenkins using Shell Script

# Shell script for installing Java, Jenkins and Maven in Ubuntu 22.0.4 EC2 instance

# Command for installing Java 11
sudo apt-get update
sudo apt-get install default-jdk -y

# Command for installing maven
sudo apt-get install maven -y

# Script for Jenkins installation

Add Repository key to the system
curl -fsSL | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Append debian package repo address to the system
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

# Install Jenkins

sudo apt-get update && sudo apt-get install jenkins -y

echo "Jenkins installed successfully.."

No comments:

Post a Comment

Azure DevOps Pipeline Optimization Best Practices | Optimizing Azure DevOps pipelines

Optimizing Azure DevOps pipelines is crucial for achieving faster and more efficient software delivery. Here are some best practices and str...