Skip to content

Instantly share code, notes, and snippets.

@joshy91
Created July 11, 2018 20:06
Show Gist options
  • Save joshy91/912cd6588269549e3a3a106a22d2d8cf to your computer and use it in GitHub Desktop.
Save joshy91/912cd6588269549e3a3a106a22d2d8cf to your computer and use it in GitHub Desktop.
#!/bin/bash
#Installs Java 8 and Jenkins on Debian based machine such as Ubuntu
#Run if a java version greater than java 8 is installed
#sudo apt-get -y remove java
sudo apt-get -y install java-1.8.0-openjdk
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
#Appends sources lists to include jenkins pkg repo
echo 'deb https://pkg.jenkins.io/debian binary/' >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get -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