Created
October 15, 2023 20:32
-
-
Save soulaway/d9af7a0af8c94f7043bfd1f77d88f9b3 to your computer and use it in GitHub Desktop.
Install Jenkins master/slave java8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jenkins:80:8080 | |
#master: | |
#update java | |
sudo yum update | |
sudo yum install java-1.8.0-openjdk | |
sudo alternatives --config java | |
sudo yum install git -y | |
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
sudo yum install -y apache-maven | |
#install jenkins | |
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo | |
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key | |
sudo yum install jenkins -y | |
sudo service jenkins start | |
#forward 80 to 8080 | |
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
#create keypair | |
cd ~/.ssh | |
ssh-keygen -t rsa | |
cat ~/.ssh/id_rsa.pub | |
#slave | |
#update java | |
sudo yum update | |
sudo yum install java-1.8.0-openjdk | |
sudo alternatives --config java | |
#install git and maven | |
sudo yum install git -y | |
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
sudo yum install -y apache-maven |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment