Skip to content

Instantly share code, notes, and snippets.

@joshy91
Last active July 11, 2018 20:20
Show Gist options
  • Save joshy91/1e8c593a232ee2219107ccd666ea85a1 to your computer and use it in GitHub Desktop.
Save joshy91/1e8c593a232ee2219107ccd666ea85a1 to your computer and use it in GitHub Desktop.
Install Jenkins on Centos7
#!/bin/bash
#Installs Java 8 and Jenkins on CentOS7
#Run if a java version greater than java 8 is installed
#sudo apt-get -y remove java
sudo yum -y install java-1.8.0-openjdk
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum -y install jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins
#Prints initial admin password to configure jenkins
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment