Jenkins_Java_ Maven_Git software Installation Bash Script

 #!/bin/bash
sudo yum update -y
sudo yum install wget tree git -y
sudo yum install java-21-amazon-corretto -y
sudo rm -rf /opt/maven*
sudo wget https://dlcdn.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz -P /tmp
sudo tar xvzf /tmp/apache-maven-3.*-bin.tar.gz -C /opt
sudo ln -s /opt/apache-maven-3.* /opt/maven
sudo touch  /etc/profile.d/maven.sh

echo '''# Apache Maven Environmental Variables
export JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto.x86_64/
export MAVEN_HOME=/opt/maven/
export PATH=${MAVEN_HOME}/bin:${PATH}:${JAVA_HOME}''' | sudo tee /etc/profile.d/maven.sh > /dev/null
sudo chmod 775 /etc/profile.d/maven.sh
source /etc/profile.d/maven.sh

sudo yum update -y
sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat-stable/jenkins.repo

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo yum install jenkins -y
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins

Comments

Popular posts from this blog

Kubernetes cluster setup NOTES step by step using minikube

Top 10 Git Commands

SonarQube Installation & Configuration Step by step